proteus  1.7.3.dev0
C/C++/Fortran libraries
csmoothers.c
Go to the documentation of this file.
1 /* Generated by Cython 0.29.21 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_21"
11 #define CYTHON_HEX_VERSION 0x001D15F0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18  #ifndef __stdcall
19  #define __stdcall
20  #endif
21  #ifndef __cdecl
22  #define __cdecl
23  #endif
24  #ifndef __fastcall
25  #define __fastcall
26  #endif
27 #endif
28 #ifndef DL_IMPORT
29  #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32  #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36  #if PY_VERSION_HEX >= 0x02070000
37  #define HAVE_LONG_LONG
38  #endif
39 #endif
40 #ifndef PY_LONG_LONG
41  #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44  #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47  #define CYTHON_COMPILING_IN_PYPY 1
48  #define CYTHON_COMPILING_IN_PYSTON 0
49  #define CYTHON_COMPILING_IN_CPYTHON 0
50  #undef CYTHON_USE_TYPE_SLOTS
51  #define CYTHON_USE_TYPE_SLOTS 0
52  #undef CYTHON_USE_PYTYPE_LOOKUP
53  #define CYTHON_USE_PYTYPE_LOOKUP 0
54  #if PY_VERSION_HEX < 0x03050000
55  #undef CYTHON_USE_ASYNC_SLOTS
56  #define CYTHON_USE_ASYNC_SLOTS 0
57  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58  #define CYTHON_USE_ASYNC_SLOTS 1
59  #endif
60  #undef CYTHON_USE_PYLIST_INTERNALS
61  #define CYTHON_USE_PYLIST_INTERNALS 0
62  #undef CYTHON_USE_UNICODE_INTERNALS
63  #define CYTHON_USE_UNICODE_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_WRITER
65  #define CYTHON_USE_UNICODE_WRITER 0
66  #undef CYTHON_USE_PYLONG_INTERNALS
67  #define CYTHON_USE_PYLONG_INTERNALS 0
68  #undef CYTHON_AVOID_BORROWED_REFS
69  #define CYTHON_AVOID_BORROWED_REFS 1
70  #undef CYTHON_ASSUME_SAFE_MACROS
71  #define CYTHON_ASSUME_SAFE_MACROS 0
72  #undef CYTHON_UNPACK_METHODS
73  #define CYTHON_UNPACK_METHODS 0
74  #undef CYTHON_FAST_THREAD_STATE
75  #define CYTHON_FAST_THREAD_STATE 0
76  #undef CYTHON_FAST_PYCALL
77  #define CYTHON_FAST_PYCALL 0
78  #undef CYTHON_PEP489_MULTI_PHASE_INIT
79  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80  #undef CYTHON_USE_TP_FINALIZE
81  #define CYTHON_USE_TP_FINALIZE 0
82  #undef CYTHON_USE_DICT_VERSIONS
83  #define CYTHON_USE_DICT_VERSIONS 0
84  #undef CYTHON_USE_EXC_INFO_STACK
85  #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87  #define CYTHON_COMPILING_IN_PYPY 0
88  #define CYTHON_COMPILING_IN_PYSTON 1
89  #define CYTHON_COMPILING_IN_CPYTHON 0
90  #ifndef CYTHON_USE_TYPE_SLOTS
91  #define CYTHON_USE_TYPE_SLOTS 1
92  #endif
93  #undef CYTHON_USE_PYTYPE_LOOKUP
94  #define CYTHON_USE_PYTYPE_LOOKUP 0
95  #undef CYTHON_USE_ASYNC_SLOTS
96  #define CYTHON_USE_ASYNC_SLOTS 0
97  #undef CYTHON_USE_PYLIST_INTERNALS
98  #define CYTHON_USE_PYLIST_INTERNALS 0
99  #ifndef CYTHON_USE_UNICODE_INTERNALS
100  #define CYTHON_USE_UNICODE_INTERNALS 1
101  #endif
102  #undef CYTHON_USE_UNICODE_WRITER
103  #define CYTHON_USE_UNICODE_WRITER 0
104  #undef CYTHON_USE_PYLONG_INTERNALS
105  #define CYTHON_USE_PYLONG_INTERNALS 0
106  #ifndef CYTHON_AVOID_BORROWED_REFS
107  #define CYTHON_AVOID_BORROWED_REFS 0
108  #endif
109  #ifndef CYTHON_ASSUME_SAFE_MACROS
110  #define CYTHON_ASSUME_SAFE_MACROS 1
111  #endif
112  #ifndef CYTHON_UNPACK_METHODS
113  #define CYTHON_UNPACK_METHODS 1
114  #endif
115  #undef CYTHON_FAST_THREAD_STATE
116  #define CYTHON_FAST_THREAD_STATE 0
117  #undef CYTHON_FAST_PYCALL
118  #define CYTHON_FAST_PYCALL 0
119  #undef CYTHON_PEP489_MULTI_PHASE_INIT
120  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121  #undef CYTHON_USE_TP_FINALIZE
122  #define CYTHON_USE_TP_FINALIZE 0
123  #undef CYTHON_USE_DICT_VERSIONS
124  #define CYTHON_USE_DICT_VERSIONS 0
125  #undef CYTHON_USE_EXC_INFO_STACK
126  #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128  #define CYTHON_COMPILING_IN_PYPY 0
129  #define CYTHON_COMPILING_IN_PYSTON 0
130  #define CYTHON_COMPILING_IN_CPYTHON 1
131  #ifndef CYTHON_USE_TYPE_SLOTS
132  #define CYTHON_USE_TYPE_SLOTS 1
133  #endif
134  #if PY_VERSION_HEX < 0x02070000
135  #undef CYTHON_USE_PYTYPE_LOOKUP
136  #define CYTHON_USE_PYTYPE_LOOKUP 0
137  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138  #define CYTHON_USE_PYTYPE_LOOKUP 1
139  #endif
140  #if PY_MAJOR_VERSION < 3
141  #undef CYTHON_USE_ASYNC_SLOTS
142  #define CYTHON_USE_ASYNC_SLOTS 0
143  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144  #define CYTHON_USE_ASYNC_SLOTS 1
145  #endif
146  #if PY_VERSION_HEX < 0x02070000
147  #undef CYTHON_USE_PYLONG_INTERNALS
148  #define CYTHON_USE_PYLONG_INTERNALS 0
149  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150  #define CYTHON_USE_PYLONG_INTERNALS 1
151  #endif
152  #ifndef CYTHON_USE_PYLIST_INTERNALS
153  #define CYTHON_USE_PYLIST_INTERNALS 1
154  #endif
155  #ifndef CYTHON_USE_UNICODE_INTERNALS
156  #define CYTHON_USE_UNICODE_INTERNALS 1
157  #endif
158  #if PY_VERSION_HEX < 0x030300F0
159  #undef CYTHON_USE_UNICODE_WRITER
160  #define CYTHON_USE_UNICODE_WRITER 0
161  #elif !defined(CYTHON_USE_UNICODE_WRITER)
162  #define CYTHON_USE_UNICODE_WRITER 1
163  #endif
164  #ifndef CYTHON_AVOID_BORROWED_REFS
165  #define CYTHON_AVOID_BORROWED_REFS 0
166  #endif
167  #ifndef CYTHON_ASSUME_SAFE_MACROS
168  #define CYTHON_ASSUME_SAFE_MACROS 1
169  #endif
170  #ifndef CYTHON_UNPACK_METHODS
171  #define CYTHON_UNPACK_METHODS 1
172  #endif
173  #ifndef CYTHON_FAST_THREAD_STATE
174  #define CYTHON_FAST_THREAD_STATE 1
175  #endif
176  #ifndef CYTHON_FAST_PYCALL
177  #define CYTHON_FAST_PYCALL 1
178  #endif
179  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181  #endif
182  #ifndef CYTHON_USE_TP_FINALIZE
183  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184  #endif
185  #ifndef CYTHON_USE_DICT_VERSIONS
186  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187  #endif
188  #ifndef CYTHON_USE_EXC_INFO_STACK
189  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190  #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196  #include "longintrepr.h"
197  #undef SHIFT
198  #undef BASE
199  #undef MASK
200  #ifdef SIZEOF_VOID_P
201  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202  #endif
203 #endif
204 #ifndef __has_attribute
205  #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208  #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211  #if defined(__GNUC__)
212  #define CYTHON_RESTRICT __restrict__
213  #elif defined(_MSC_VER) && _MSC_VER >= 1400
214  #define CYTHON_RESTRICT __restrict
215  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216  #define CYTHON_RESTRICT restrict
217  #else
218  #define CYTHON_RESTRICT
219  #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
225 # else
226 # define CYTHON_UNUSED
227 # endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 # define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 # else
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 # endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
244 # else
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250  #ifndef _MSC_STDINT_H_
251  #if _MSC_VER < 1300
252  typedef unsigned char uint8_t;
253  typedef unsigned int uint32_t;
254  #else
255  typedef unsigned __int8 uint8_t;
256  typedef unsigned __int32 uint32_t;
257  #endif
258  #endif
259 #else
260  #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263  #if defined(__cplusplus) && __cplusplus >= 201103L
264  #if __has_cpp_attribute(fallthrough)
265  #define CYTHON_FALLTHROUGH [[fallthrough]]
266  #elif __has_cpp_attribute(clang::fallthrough)
267  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268  #elif __has_cpp_attribute(gnu::fallthrough)
269  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270  #endif
271  #endif
272  #ifndef CYTHON_FALLTHROUGH
273  #if __has_attribute(fallthrough)
274  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275  #else
276  #define CYTHON_FALLTHROUGH
277  #endif
278  #endif
279  #if defined(__clang__ ) && defined(__apple_build_version__)
280  #if __apple_build_version__ < 7000000
281  #undef CYTHON_FALLTHROUGH
282  #define CYTHON_FALLTHROUGH
283  #endif
284  #endif
285 #endif
286 
287 #ifndef CYTHON_INLINE
288  #if defined(__clang__)
289  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
290  #elif defined(__GNUC__)
291  #define CYTHON_INLINE __inline__
292  #elif defined(_MSC_VER)
293  #define CYTHON_INLINE __inline
294  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
295  #define CYTHON_INLINE inline
296  #else
297  #define CYTHON_INLINE
298  #endif
299 #endif
300 
301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
302  #define Py_OptimizeFlag 0
303 #endif
304 #define __PYX_BUILD_PY_SSIZE_T "n"
305 #define CYTHON_FORMAT_SSIZE_T "z"
306 #if PY_MAJOR_VERSION < 3
307  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
308  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
309  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
310  #define __Pyx_DefaultClassType PyClass_Type
311 #else
312  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
314  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
315  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
316 #else
317  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
318  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
319 #endif
320  #define __Pyx_DefaultClassType PyType_Type
321 #endif
322 #ifndef Py_TPFLAGS_CHECKTYPES
323  #define Py_TPFLAGS_CHECKTYPES 0
324 #endif
325 #ifndef Py_TPFLAGS_HAVE_INDEX
326  #define Py_TPFLAGS_HAVE_INDEX 0
327 #endif
328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
329  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
330 #endif
331 #ifndef Py_TPFLAGS_HAVE_FINALIZE
332  #define Py_TPFLAGS_HAVE_FINALIZE 0
333 #endif
334 #ifndef METH_STACKLESS
335  #define METH_STACKLESS 0
336 #endif
337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
338  #ifndef METH_FASTCALL
339  #define METH_FASTCALL 0x80
340  #endif
341  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
342  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
343  Py_ssize_t nargs, PyObject *kwnames);
344 #else
345  #define __Pyx_PyCFunctionFast _PyCFunctionFast
346  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
347 #endif
348 #if CYTHON_FAST_PYCCALL
349 #define __Pyx_PyFastCFunction_Check(func)\
350  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
351 #else
352 #define __Pyx_PyFastCFunction_Check(func) 0
353 #endif
354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
355  #define PyObject_Malloc(s) PyMem_Malloc(s)
356  #define PyObject_Free(p) PyMem_Free(p)
357  #define PyObject_Realloc(p) PyMem_Realloc(p)
358 #endif
359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
360  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
361  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
362  #define PyMem_RawFree(p) PyMem_Free(p)
363 #endif
364 #if CYTHON_COMPILING_IN_PYSTON
365  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
366  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
367 #else
368  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
369  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
370 #endif
371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
372  #define __Pyx_PyThreadState_Current PyThreadState_GET()
373 #elif PY_VERSION_HEX >= 0x03060000
374  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
375 #elif PY_VERSION_HEX >= 0x03000000
376  #define __Pyx_PyThreadState_Current PyThreadState_GET()
377 #else
378  #define __Pyx_PyThreadState_Current _PyThreadState_Current
379 #endif
380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
381 #include "pythread.h"
382 #define Py_tss_NEEDS_INIT 0
383 typedef int Py_tss_t;
384 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
385  *key = PyThread_create_key();
386  return 0;
387 }
388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
389  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
390  *key = Py_tss_NEEDS_INIT;
391  return key;
392 }
393 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
394  PyObject_Free(key);
395 }
396 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
397  return *key != Py_tss_NEEDS_INIT;
398 }
399 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
400  PyThread_delete_key(*key);
401  *key = Py_tss_NEEDS_INIT;
402 }
403 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
404  return PyThread_set_key_value(*key, value);
405 }
406 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
407  return PyThread_get_key_value(*key);
408 }
409 #endif
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
411 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
412 #else
413 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
414 #endif
415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
416  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
417  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
418 #else
419  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
420  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
421 #endif
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
423 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
424 #else
425 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
426 #endif
427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
428  #define CYTHON_PEP393_ENABLED 1
429  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
430  0 : _PyUnicode_Ready((PyObject *)(op)))
431  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
432  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
433  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
434  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
435  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
436  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
437  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
438  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
439  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
440  #else
441  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
442  #endif
443 #else
444  #define CYTHON_PEP393_ENABLED 0
445  #define PyUnicode_1BYTE_KIND 1
446  #define PyUnicode_2BYTE_KIND 2
447  #define PyUnicode_4BYTE_KIND 4
448  #define __Pyx_PyUnicode_READY(op) (0)
449  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
450  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
451  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
452  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
453  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
454  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
455  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
456  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
457 #endif
458 #if CYTHON_COMPILING_IN_PYPY
459  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
460  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
461 #else
462  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
463  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
464  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
465 #endif
466 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
467  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
468 #endif
469 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
470  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
471 #endif
472 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
473  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
474 #endif
475 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
476 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
477 #if PY_MAJOR_VERSION >= 3
478  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
479 #else
480  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
481 #endif
482 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
483  #define PyObject_ASCII(o) PyObject_Repr(o)
484 #endif
485 #if PY_MAJOR_VERSION >= 3
486  #define PyBaseString_Type PyUnicode_Type
487  #define PyStringObject PyUnicodeObject
488  #define PyString_Type PyUnicode_Type
489  #define PyString_Check PyUnicode_Check
490  #define PyString_CheckExact PyUnicode_CheckExact
491 #ifndef PyObject_Unicode
492  #define PyObject_Unicode PyObject_Str
493 #endif
494 #endif
495 #if PY_MAJOR_VERSION >= 3
496  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
497  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
498 #else
499  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
500  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
501 #endif
502 #ifndef PySet_CheckExact
503  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
504 #endif
505 #if PY_VERSION_HEX >= 0x030900A4
506  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
507  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
508 #else
509  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
510  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
511 #endif
512 #if CYTHON_ASSUME_SAFE_MACROS
513  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
514 #else
515  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
516 #endif
517 #if PY_MAJOR_VERSION >= 3
518  #define PyIntObject PyLongObject
519  #define PyInt_Type PyLong_Type
520  #define PyInt_Check(op) PyLong_Check(op)
521  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
522  #define PyInt_FromString PyLong_FromString
523  #define PyInt_FromUnicode PyLong_FromUnicode
524  #define PyInt_FromLong PyLong_FromLong
525  #define PyInt_FromSize_t PyLong_FromSize_t
526  #define PyInt_FromSsize_t PyLong_FromSsize_t
527  #define PyInt_AsLong PyLong_AsLong
528  #define PyInt_AS_LONG PyLong_AS_LONG
529  #define PyInt_AsSsize_t PyLong_AsSsize_t
530  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
531  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
532  #define PyNumber_Int PyNumber_Long
533 #endif
534 #if PY_MAJOR_VERSION >= 3
535  #define PyBoolObject PyLongObject
536 #endif
537 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
538  #ifndef PyUnicode_InternFromString
539  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
540  #endif
541 #endif
542 #if PY_VERSION_HEX < 0x030200A4
543  typedef long Py_hash_t;
544  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
545  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
546 #else
547  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
548  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
549 #endif
550 #if PY_MAJOR_VERSION >= 3
551  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
552 #else
553  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
554 #endif
555 #if CYTHON_USE_ASYNC_SLOTS
556  #if PY_VERSION_HEX >= 0x030500B1
557  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
558  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
559  #else
560  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
561  #endif
562 #else
563  #define __Pyx_PyType_AsAsync(obj) NULL
564 #endif
565 #ifndef __Pyx_PyAsyncMethodsStruct
566  typedef struct {
567  unaryfunc am_await;
568  unaryfunc am_aiter;
569  unaryfunc am_anext;
570  } __Pyx_PyAsyncMethodsStruct;
571 #endif
572 
573 #if defined(WIN32) || defined(MS_WINDOWS)
574  #define _USE_MATH_DEFINES
575 #endif
576 #include <math.h>
577 #ifdef NAN
578 #define __PYX_NAN() ((float) NAN)
579 #else
580 static CYTHON_INLINE float __PYX_NAN() {
581  float value;
582  memset(&value, 0xFF, sizeof(value));
583  return value;
584 }
585 #endif
586 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
587 #define __Pyx_truncl trunc
588 #else
589 #define __Pyx_truncl truncl
590 #endif
591 
592 #define __PYX_MARK_ERR_POS(f_index, lineno) \
593  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
594 #define __PYX_ERR(f_index, lineno, Ln_error) \
595  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
596 
597 #ifndef __PYX_EXTERN_C
598  #ifdef __cplusplus
599  #define __PYX_EXTERN_C extern "C"
600  #else
601  #define __PYX_EXTERN_C extern
602  #endif
603 #endif
604 
605 #define __PYX_HAVE__csmoothers
606 #define __PYX_HAVE_API__csmoothers
607 /* Early includes */
608 #include <string.h>
609 #include <stdio.h>
610 #include "numpy/arrayobject.h"
611 #include "numpy/ufuncobject.h"
612 
613  /* NumPy API declarations from "numpy/__init__.pxd" */
614 
615 #include "proteus_superlu.h"
616 #include "smoothers.h"
617 #include "pythread.h"
618 #include <stdlib.h>
619 #include "pystate.h"
620 #ifdef _OPENMP
621 #include <omp.h>
622 #endif /* _OPENMP */
623 
624 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
625 #define CYTHON_WITHOUT_ASSERTIONS
626 #endif
627 
628 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
629  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
630 
631 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
632 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
633 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
634 #define __PYX_DEFAULT_STRING_ENCODING ""
635 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
636 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
637 #define __Pyx_uchar_cast(c) ((unsigned char)c)
638 #define __Pyx_long_cast(x) ((long)x)
639 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
640  (sizeof(type) < sizeof(Py_ssize_t)) ||\
641  (sizeof(type) > sizeof(Py_ssize_t) &&\
642  likely(v < (type)PY_SSIZE_T_MAX ||\
643  v == (type)PY_SSIZE_T_MAX) &&\
644  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
645  v == (type)PY_SSIZE_T_MIN))) ||\
646  (sizeof(type) == sizeof(Py_ssize_t) &&\
647  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
648  v == (type)PY_SSIZE_T_MAX))) )
649 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
650  return (size_t) i < (size_t) limit;
651 }
652 #if defined (__cplusplus) && __cplusplus >= 201103L
653  #include <cstdlib>
654  #define __Pyx_sst_abs(value) std::abs(value)
655 #elif SIZEOF_INT >= SIZEOF_SIZE_T
656  #define __Pyx_sst_abs(value) abs(value)
657 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
658  #define __Pyx_sst_abs(value) labs(value)
659 #elif defined (_MSC_VER)
660  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
661 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
662  #define __Pyx_sst_abs(value) llabs(value)
663 #elif defined (__GNUC__)
664  #define __Pyx_sst_abs(value) __builtin_llabs(value)
665 #else
666  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
667 #endif
668 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
669 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
670 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
671 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
672 #define __Pyx_PyBytes_FromString PyBytes_FromString
673 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
674 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
675 #if PY_MAJOR_VERSION < 3
676  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
677  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
678 #else
679  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
680  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
681 #endif
682 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
683 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
684 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
685 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
686 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
687 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
688 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
689 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
690 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
691 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
692 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
693 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
694 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
695 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
696 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
697 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
698 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
699  const Py_UNICODE *u_end = u;
700  while (*u_end++) ;
701  return (size_t)(u_end - u - 1);
702 }
703 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
704 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
705 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
706 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
707 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
708 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
709 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
710 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
711 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
712 #define __Pyx_PySequence_Tuple(obj)\
713  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
714 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
715 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
716 #if CYTHON_ASSUME_SAFE_MACROS
717 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
718 #else
719 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
720 #endif
721 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
722 #if PY_MAJOR_VERSION >= 3
723 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
724 #else
725 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
726 #endif
727 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
728 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
729 static int __Pyx_sys_getdefaultencoding_not_ascii;
730 static int __Pyx_init_sys_getdefaultencoding_params(void) {
731  PyObject* sys;
732  PyObject* default_encoding = NULL;
733  PyObject* ascii_chars_u = NULL;
734  PyObject* ascii_chars_b = NULL;
735  const char* default_encoding_c;
736  sys = PyImport_ImportModule("sys");
737  if (!sys) goto bad;
738  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
739  Py_DECREF(sys);
740  if (!default_encoding) goto bad;
741  default_encoding_c = PyBytes_AsString(default_encoding);
742  if (!default_encoding_c) goto bad;
743  if (strcmp(default_encoding_c, "ascii") == 0) {
744  __Pyx_sys_getdefaultencoding_not_ascii = 0;
745  } else {
746  char ascii_chars[128];
747  int c;
748  for (c = 0; c < 128; c++) {
749  ascii_chars[c] = c;
750  }
751  __Pyx_sys_getdefaultencoding_not_ascii = 1;
752  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
753  if (!ascii_chars_u) goto bad;
754  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
755  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
756  PyErr_Format(
757  PyExc_ValueError,
758  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
759  default_encoding_c);
760  goto bad;
761  }
762  Py_DECREF(ascii_chars_u);
763  Py_DECREF(ascii_chars_b);
764  }
765  Py_DECREF(default_encoding);
766  return 0;
767 bad:
768  Py_XDECREF(default_encoding);
769  Py_XDECREF(ascii_chars_u);
770  Py_XDECREF(ascii_chars_b);
771  return -1;
772 }
773 #endif
774 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
775 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
776 #else
777 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
778 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
779 static char* __PYX_DEFAULT_STRING_ENCODING;
780 static int __Pyx_init_sys_getdefaultencoding_params(void) {
781  PyObject* sys;
782  PyObject* default_encoding = NULL;
783  char* default_encoding_c;
784  sys = PyImport_ImportModule("sys");
785  if (!sys) goto bad;
786  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
787  Py_DECREF(sys);
788  if (!default_encoding) goto bad;
789  default_encoding_c = PyBytes_AsString(default_encoding);
790  if (!default_encoding_c) goto bad;
791  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
792  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
793  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
794  Py_DECREF(default_encoding);
795  return 0;
796 bad:
797  Py_XDECREF(default_encoding);
798  return -1;
799 }
800 #endif
801 #endif
802 
803 
804 /* Test for GCC > 2.95 */
805 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
806  #define likely(x) __builtin_expect(!!(x), 1)
807  #define unlikely(x) __builtin_expect(!!(x), 0)
808 #else /* !__GNUC__ or GCC < 2.95 */
809  #define likely(x) (x)
810  #define unlikely(x) (x)
811 #endif /* __GNUC__ */
812 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
813 
814 static PyObject *__pyx_m = NULL;
815 static PyObject *__pyx_d;
816 static PyObject *__pyx_b;
817 static PyObject *__pyx_cython_runtime = NULL;
818 static PyObject *__pyx_empty_tuple;
819 static PyObject *__pyx_empty_bytes;
820 static PyObject *__pyx_empty_unicode;
821 static int __pyx_lineno;
822 static int __pyx_clineno = 0;
823 static const char * __pyx_cfilenm= __FILE__;
824 static const char *__pyx_filename;
825 
826 /* Header.proto */
827 #if !defined(CYTHON_CCOMPLEX)
828  #if defined(__cplusplus)
829  #define CYTHON_CCOMPLEX 1
830  #elif defined(_Complex_I)
831  #define CYTHON_CCOMPLEX 1
832  #else
833  #define CYTHON_CCOMPLEX 0
834  #endif
835 #endif
836 #if CYTHON_CCOMPLEX
837  #ifdef __cplusplus
838  #include <complex>
839  #else
840  #include <complex.h>
841  #endif
842 #endif
843 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
844  #undef _Complex_I
845  #define _Complex_I 1.0fj
846 #endif
847 
848 
849 static const char *__pyx_f[] = {
850  "proteus/csmoothers.pyx",
851  "stringsource",
852  "__init__.pxd",
853  "type.pxd",
854  "proteus/superluWrappers.pxd",
855 };
856 /* MemviewSliceStruct.proto */
857 struct __pyx_memoryview_obj;
858 typedef struct {
859  struct __pyx_memoryview_obj *memview;
860  char *data;
861  Py_ssize_t shape[8];
862  Py_ssize_t strides[8];
863  Py_ssize_t suboffsets[8];
864 } __Pyx_memviewslice;
865 #define __Pyx_MemoryView_Len(m) (m.shape[0])
866 
867 /* Atomics.proto */
868 #include <pythread.h>
869 #ifndef CYTHON_ATOMICS
870  #define CYTHON_ATOMICS 1
871 #endif
872 #define __pyx_atomic_int_type int
873 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
874  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
875  !defined(__i386__)
876  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
877  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
878  #ifdef __PYX_DEBUG_ATOMICS
879  #warning "Using GNU atomics"
880  #endif
881 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
882  #include <Windows.h>
883  #undef __pyx_atomic_int_type
884  #define __pyx_atomic_int_type LONG
885  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
886  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
887  #ifdef __PYX_DEBUG_ATOMICS
888  #pragma message ("Using MSVC atomics")
889  #endif
890 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
891  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
892  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
893  #ifdef __PYX_DEBUG_ATOMICS
894  #warning "Using Intel atomics"
895  #endif
896 #else
897  #undef CYTHON_ATOMICS
898  #define CYTHON_ATOMICS 0
899  #ifdef __PYX_DEBUG_ATOMICS
900  #warning "Not using atomics"
901  #endif
902 #endif
903 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
904 #if CYTHON_ATOMICS
905  #define __pyx_add_acquisition_count(memview)\
906  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
907  #define __pyx_sub_acquisition_count(memview)\
908  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
909 #else
910  #define __pyx_add_acquisition_count(memview)\
911  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
912  #define __pyx_sub_acquisition_count(memview)\
913  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
914 #endif
915 
916 /* ForceInitThreads.proto */
917 #ifndef __PYX_FORCE_INIT_THREADS
918  #define __PYX_FORCE_INIT_THREADS 0
919 #endif
920 
921 /* NoFastGil.proto */
922 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
923 #define __Pyx_PyGILState_Release PyGILState_Release
924 #define __Pyx_FastGIL_Remember()
925 #define __Pyx_FastGIL_Forget()
926 #define __Pyx_FastGilFuncInit()
927 
928 /* BufferFormatStructs.proto */
929 #define IS_UNSIGNED(type) (((type) -1) > 0)
930 struct __Pyx_StructField_;
931 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
932 typedef struct {
933  const char* name;
934  struct __Pyx_StructField_* fields;
935  size_t size;
936  size_t arraysize[8];
937  int ndim;
938  char typegroup;
939  char is_unsigned;
940  int flags;
941 } __Pyx_TypeInfo;
942 typedef struct __Pyx_StructField_ {
943  __Pyx_TypeInfo* type;
944  const char* name;
945  size_t offset;
946 } __Pyx_StructField;
947 typedef struct {
948  __Pyx_StructField* field;
949  size_t parent_offset;
950 } __Pyx_BufFmt_StackElem;
951 typedef struct {
952  __Pyx_StructField root;
953  __Pyx_BufFmt_StackElem* head;
954  size_t fmt_offset;
955  size_t new_count, enc_count;
956  size_t struct_alignment;
957  int is_complex;
958  char enc_type;
959  char new_packmode;
960  char enc_packmode;
961  char is_valid_array;
962 } __Pyx_BufFmt_Context;
963 
964 
965 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":697
966  * # in Cython to enable them only on the right systems.
967  *
968  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
969  * ctypedef npy_int16 int16_t
970  * ctypedef npy_int32 int32_t
971  */
972 typedef npy_int8 __pyx_t_5numpy_int8_t;
973 
974 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":698
975  *
976  * ctypedef npy_int8 int8_t
977  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
978  * ctypedef npy_int32 int32_t
979  * ctypedef npy_int64 int64_t
980  */
981 typedef npy_int16 __pyx_t_5numpy_int16_t;
982 
983 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":699
984  * ctypedef npy_int8 int8_t
985  * ctypedef npy_int16 int16_t
986  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
987  * ctypedef npy_int64 int64_t
988  * #ctypedef npy_int96 int96_t
989  */
990 typedef npy_int32 __pyx_t_5numpy_int32_t;
991 
992 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":700
993  * ctypedef npy_int16 int16_t
994  * ctypedef npy_int32 int32_t
995  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
996  * #ctypedef npy_int96 int96_t
997  * #ctypedef npy_int128 int128_t
998  */
999 typedef npy_int64 __pyx_t_5numpy_int64_t;
1000 
1001 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":704
1002  * #ctypedef npy_int128 int128_t
1003  *
1004  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1005  * ctypedef npy_uint16 uint16_t
1006  * ctypedef npy_uint32 uint32_t
1007  */
1008 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1009 
1010 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":705
1011  *
1012  * ctypedef npy_uint8 uint8_t
1013  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1014  * ctypedef npy_uint32 uint32_t
1015  * ctypedef npy_uint64 uint64_t
1016  */
1017 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1018 
1019 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":706
1020  * ctypedef npy_uint8 uint8_t
1021  * ctypedef npy_uint16 uint16_t
1022  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1023  * ctypedef npy_uint64 uint64_t
1024  * #ctypedef npy_uint96 uint96_t
1025  */
1026 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1027 
1028 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":707
1029  * ctypedef npy_uint16 uint16_t
1030  * ctypedef npy_uint32 uint32_t
1031  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1032  * #ctypedef npy_uint96 uint96_t
1033  * #ctypedef npy_uint128 uint128_t
1034  */
1035 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1036 
1037 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":711
1038  * #ctypedef npy_uint128 uint128_t
1039  *
1040  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1041  * ctypedef npy_float64 float64_t
1042  * #ctypedef npy_float80 float80_t
1043  */
1044 typedef npy_float32 __pyx_t_5numpy_float32_t;
1045 
1046 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":712
1047  *
1048  * ctypedef npy_float32 float32_t
1049  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1050  * #ctypedef npy_float80 float80_t
1051  * #ctypedef npy_float128 float128_t
1052  */
1053 typedef npy_float64 __pyx_t_5numpy_float64_t;
1054 
1055 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":721
1056  * # The int types are mapped a bit surprising --
1057  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1058  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1059  * ctypedef npy_longlong long_t
1060  * ctypedef npy_longlong longlong_t
1061  */
1062 typedef npy_long __pyx_t_5numpy_int_t;
1063 
1064 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":722
1065  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1066  * ctypedef npy_long int_t
1067  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1068  * ctypedef npy_longlong longlong_t
1069  *
1070  */
1071 typedef npy_longlong __pyx_t_5numpy_long_t;
1072 
1073 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":723
1074  * ctypedef npy_long int_t
1075  * ctypedef npy_longlong long_t
1076  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1077  *
1078  * ctypedef npy_ulong uint_t
1079  */
1080 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1081 
1082 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":725
1083  * ctypedef npy_longlong longlong_t
1084  *
1085  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1086  * ctypedef npy_ulonglong ulong_t
1087  * ctypedef npy_ulonglong ulonglong_t
1088  */
1089 typedef npy_ulong __pyx_t_5numpy_uint_t;
1090 
1091 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":726
1092  *
1093  * ctypedef npy_ulong uint_t
1094  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1095  * ctypedef npy_ulonglong ulonglong_t
1096  *
1097  */
1098 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1099 
1100 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":727
1101  * ctypedef npy_ulong uint_t
1102  * ctypedef npy_ulonglong ulong_t
1103  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1104  *
1105  * ctypedef npy_intp intp_t
1106  */
1107 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1108 
1109 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":729
1110  * ctypedef npy_ulonglong ulonglong_t
1111  *
1112  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1113  * ctypedef npy_uintp uintp_t
1114  *
1115  */
1116 typedef npy_intp __pyx_t_5numpy_intp_t;
1117 
1118 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":730
1119  *
1120  * ctypedef npy_intp intp_t
1121  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1122  *
1123  * ctypedef npy_double float_t
1124  */
1125 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1126 
1127 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":732
1128  * ctypedef npy_uintp uintp_t
1129  *
1130  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1131  * ctypedef npy_double double_t
1132  * ctypedef npy_longdouble longdouble_t
1133  */
1134 typedef npy_double __pyx_t_5numpy_float_t;
1135 
1136 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":733
1137  *
1138  * ctypedef npy_double float_t
1139  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1140  * ctypedef npy_longdouble longdouble_t
1141  *
1142  */
1143 typedef npy_double __pyx_t_5numpy_double_t;
1144 
1145 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":734
1146  * ctypedef npy_double float_t
1147  * ctypedef npy_double double_t
1148  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1149  *
1150  * ctypedef npy_cfloat cfloat_t
1151  */
1152 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1153 
1154 /* "csmoothers.pxd":3
1155  * from proteus cimport superluWrappers
1156  *
1157  * ctypedef int PROTEUS_LAPACK_INTEGER # <<<<<<<<<<<<<<
1158  * # ARB - the compiler macro does not seem to be picking this up...
1159  * ctypedef double [:] DDATA
1160  */
1161 typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
1162 /* Declarations.proto */
1163 #if CYTHON_CCOMPLEX
1164  #ifdef __cplusplus
1165  typedef ::std::complex< float > __pyx_t_float_complex;
1166  #else
1167  typedef float _Complex __pyx_t_float_complex;
1168  #endif
1169 #else
1170  typedef struct { float real, imag; } __pyx_t_float_complex;
1171 #endif
1172 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1173 
1174 /* Declarations.proto */
1175 #if CYTHON_CCOMPLEX
1176  #ifdef __cplusplus
1177  typedef ::std::complex< double > __pyx_t_double_complex;
1178  #else
1179  typedef double _Complex __pyx_t_double_complex;
1180  #endif
1181 #else
1182  typedef struct { double real, imag; } __pyx_t_double_complex;
1183 #endif
1184 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1185 
1186 
1187 /*--- Type declarations ---*/
1188 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
1189 struct __pyx_obj_10csmoothers_cASMFactor;
1190 struct __pyx_obj_10csmoothers_cBASMFactor;
1191 struct __pyx_array_obj;
1192 struct __pyx_MemviewEnum_obj;
1193 struct __pyx_memoryview_obj;
1194 struct __pyx_memoryviewslice_obj;
1195 
1196 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":736
1197  * ctypedef npy_longdouble longdouble_t
1198  *
1199  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1200  * ctypedef npy_cdouble cdouble_t
1201  * ctypedef npy_clongdouble clongdouble_t
1202  */
1203 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1204 
1205 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":737
1206  *
1207  * ctypedef npy_cfloat cfloat_t
1208  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1209  * ctypedef npy_clongdouble clongdouble_t
1210  *
1211  */
1212 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1213 
1214 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":738
1215  * ctypedef npy_cfloat cfloat_t
1216  * ctypedef npy_cdouble cdouble_t
1217  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1218  *
1219  * ctypedef npy_cdouble complex_t
1220  */
1221 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1222 
1223 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":740
1224  * ctypedef npy_clongdouble clongdouble_t
1225  *
1226  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1227  *
1228  * cdef inline object PyArray_MultiIterNew1(a):
1229  */
1230 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1231 struct __pyx_t_7proteus_15superluWrappers__NRformat;
1232 
1233 /* "superluWrappers.pxd":61
1234  * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
1235  *
1236  * cdef struct _NRformat: # <<<<<<<<<<<<<<
1237  * np.int32_t nnz
1238  * np.float64_t * nzval
1239  */
1240 struct __pyx_t_7proteus_15superluWrappers__NRformat {
1241  __pyx_t_5numpy_int32_t nnz;
1242  __pyx_t_5numpy_float64_t *nzval;
1243  __pyx_t_5numpy_int32_t *colind;
1244  __pyx_t_5numpy_int32_t *rowptr;
1245 };
1246 
1247 /* "csmoothers.pxd":5
1248  * ctypedef int PROTEUS_LAPACK_INTEGER
1249  * # ARB - the compiler macro does not seem to be picking this up...
1250  * ctypedef double [:] DDATA # <<<<<<<<<<<<<<
1251  * ctypedef int [:] IDATA
1252  * ctypedef superluWrappers._SuperMatrix SuperMatrix
1253  */
1254 typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
1255 
1256 /* "csmoothers.pxd":6
1257  * # ARB - the compiler macro does not seem to be picking this up...
1258  * ctypedef double [:] DDATA
1259  * ctypedef int [:] IDATA # <<<<<<<<<<<<<<
1260  * ctypedef superluWrappers._SuperMatrix SuperMatrix
1261  *
1262  */
1263 typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
1264 
1265 /* "csmoothers.pxd":7
1266  * ctypedef double [:] DDATA
1267  * ctypedef int [:] IDATA
1268  * ctypedef superluWrappers._SuperMatrix SuperMatrix # <<<<<<<<<<<<<<
1269  *
1270  * cdef extern from "smoothers.h":
1271  */
1272 typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
1273 
1274 /* "superluWrappers.pxd":67
1275  * np.int32_t * rowptr
1276  *
1277  * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
1278  * cdef np.int32_t dim[2]
1279  * cdef _NRformat A
1280  */
1281 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
1282  PyObject_HEAD
1283  __pyx_t_5numpy_int32_t dim[2];
1284  struct __pyx_t_7proteus_15superluWrappers__NRformat A;
1285 };
1286 
1287 
1288 /* "csmoothers.pxd":25
1289  * void cbasm_NR_solve "basm_NR_solve"(int rowBlocks, int N, superluWrappers._SuperMatrix *A, double w, double** subdomainL, int* subdomain_dim, int** l2g_L, double* R, double** subdomainR, int* node_order, double** subdomain_dX, double* dX, PROTEUS_LAPACK_INTEGER** subdomainPivots, PROTEUS_LAPACK_INTEGER** subdomainColPivots)
1290  *
1291  * cdef class cASMFactor(object): # <<<<<<<<<<<<<<
1292  * cdef int N
1293  * cdef int *subdomain_dim
1294  */
1295 struct __pyx_obj_10csmoothers_cASMFactor {
1296  PyObject_HEAD
1297  int N;
1298  int *subdomain_dim;
1299  int **l2g_L;
1300  double **subdomain_L;
1301  double **subdomain_R;
1302  double **subdomain_dX;
1303  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1304 };
1305 
1306 
1307 /* "csmoothers.pxd":34
1308  * cdef PROTEUS_LAPACK_INTEGER **subdomain_pivots
1309  *
1310  * cdef class cBASMFactor(object): # <<<<<<<<<<<<<<
1311  * cdef int N
1312  * cdef int bs
1313  */
1314 struct __pyx_obj_10csmoothers_cBASMFactor {
1315  PyObject_HEAD
1316  int N;
1317  int bs;
1318  int *subdomain_dim;
1319  int **l2g_L;
1320  double **subdomain_L;
1321  double **subdomain_R;
1322  double **subdomain_dX;
1323  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1324  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
1325 };
1326 
1327 
1328 /* "View.MemoryView":105
1329  *
1330  * @cname("__pyx_array")
1331  * cdef class array: # <<<<<<<<<<<<<<
1332  *
1333  * cdef:
1334  */
1335 struct __pyx_array_obj {
1336  PyObject_HEAD
1337  struct __pyx_vtabstruct_array *__pyx_vtab;
1338  char *data;
1339  Py_ssize_t len;
1340  char *format;
1341  int ndim;
1342  Py_ssize_t *_shape;
1343  Py_ssize_t *_strides;
1344  Py_ssize_t itemsize;
1345  PyObject *mode;
1346  PyObject *_format;
1347  void (*callback_free_data)(void *);
1348  int free_data;
1349  int dtype_is_object;
1350 };
1351 
1352 
1353 /* "View.MemoryView":279
1354  *
1355  * @cname('__pyx_MemviewEnum')
1356  * cdef class Enum(object): # <<<<<<<<<<<<<<
1357  * cdef object name
1358  * def __init__(self, name):
1359  */
1360 struct __pyx_MemviewEnum_obj {
1361  PyObject_HEAD
1362  PyObject *name;
1363 };
1364 
1365 
1366 /* "View.MemoryView":330
1367  *
1368  * @cname('__pyx_memoryview')
1369  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1370  *
1371  * cdef object obj
1372  */
1373 struct __pyx_memoryview_obj {
1374  PyObject_HEAD
1375  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1376  PyObject *obj;
1377  PyObject *_size;
1378  PyObject *_array_interface;
1379  PyThread_type_lock lock;
1380  __pyx_atomic_int acquisition_count[2];
1381  __pyx_atomic_int *acquisition_count_aligned_p;
1382  Py_buffer view;
1383  int flags;
1384  int dtype_is_object;
1385  __Pyx_TypeInfo *typeinfo;
1386 };
1387 
1388 
1389 /* "View.MemoryView":965
1390  *
1391  * @cname('__pyx_memoryviewslice')
1392  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1393  * "Internal class for passing memoryview slices to Python"
1394  *
1395  */
1396 struct __pyx_memoryviewslice_obj {
1397  struct __pyx_memoryview_obj __pyx_base;
1398  __Pyx_memviewslice from_slice;
1399  PyObject *from_object;
1400  PyObject *(*to_object_func)(char *);
1401  int (*to_dtype_func)(char *, PyObject *);
1402 };
1403 
1404 
1405 
1406 /* "View.MemoryView":105
1407  *
1408  * @cname("__pyx_array")
1409  * cdef class array: # <<<<<<<<<<<<<<
1410  *
1411  * cdef:
1412  */
1413 
1414 struct __pyx_vtabstruct_array {
1415  PyObject *(*get_memview)(struct __pyx_array_obj *);
1416 };
1417 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1418 
1419 
1420 /* "View.MemoryView":330
1421  *
1422  * @cname('__pyx_memoryview')
1423  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1424  *
1425  * cdef object obj
1426  */
1427 
1428 struct __pyx_vtabstruct_memoryview {
1429  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1430  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1431  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1432  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1433  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1434  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1435  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1436 };
1437 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1438 
1439 
1440 /* "View.MemoryView":965
1441  *
1442  * @cname('__pyx_memoryviewslice')
1443  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1444  * "Internal class for passing memoryview slices to Python"
1445  *
1446  */
1447 
1448 struct __pyx_vtabstruct__memoryviewslice {
1449  struct __pyx_vtabstruct_memoryview __pyx_base;
1450 };
1451 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1452 
1453 /* --- Runtime support code (head) --- */
1454 /* Refnanny.proto */
1455 #ifndef CYTHON_REFNANNY
1456  #define CYTHON_REFNANNY 0
1457 #endif
1458 #if CYTHON_REFNANNY
1459  typedef struct {
1460  void (*INCREF)(void*, PyObject*, int);
1461  void (*DECREF)(void*, PyObject*, int);
1462  void (*GOTREF)(void*, PyObject*, int);
1463  void (*GIVEREF)(void*, PyObject*, int);
1464  void* (*SetupContext)(const char*, int, const char*);
1465  void (*FinishContext)(void**);
1466  } __Pyx_RefNannyAPIStruct;
1467  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1468  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1469  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1470 #ifdef WITH_THREAD
1471  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1472  if (acquire_gil) {\
1473  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1474  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1475  PyGILState_Release(__pyx_gilstate_save);\
1476  } else {\
1477  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1478  }
1479 #else
1480  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1481  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1482 #endif
1483  #define __Pyx_RefNannyFinishContext()\
1484  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1485  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1486  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1487  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1488  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1489  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1490  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1491  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1492  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1493 #else
1494  #define __Pyx_RefNannyDeclarations
1495  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1496  #define __Pyx_RefNannyFinishContext()
1497  #define __Pyx_INCREF(r) Py_INCREF(r)
1498  #define __Pyx_DECREF(r) Py_DECREF(r)
1499  #define __Pyx_GOTREF(r)
1500  #define __Pyx_GIVEREF(r)
1501  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1502  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1503  #define __Pyx_XGOTREF(r)
1504  #define __Pyx_XGIVEREF(r)
1505 #endif
1506 #define __Pyx_XDECREF_SET(r, v) do {\
1507  PyObject *tmp = (PyObject *) r;\
1508  r = v; __Pyx_XDECREF(tmp);\
1509  } while (0)
1510 #define __Pyx_DECREF_SET(r, v) do {\
1511  PyObject *tmp = (PyObject *) r;\
1512  r = v; __Pyx_DECREF(tmp);\
1513  } while (0)
1514 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1515 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1516 
1517 /* PyObjectGetAttrStr.proto */
1518 #if CYTHON_USE_TYPE_SLOTS
1519 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1520 #else
1521 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1522 #endif
1523 
1524 /* GetBuiltinName.proto */
1525 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1526 
1527 /* RaiseArgTupleInvalid.proto */
1528 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1529  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1530 
1531 /* RaiseDoubleKeywords.proto */
1532 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1533 
1534 /* ParseKeywords.proto */
1535 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1536  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1537  const char* function_name);
1538 
1539 /* PyObjectSetAttrStr.proto */
1540 #if CYTHON_USE_TYPE_SLOTS
1541 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1542 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1543 #else
1544 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1545 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1546 #endif
1547 
1548 /* PyCFunctionFastCall.proto */
1549 #if CYTHON_FAST_PYCCALL
1550 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1551 #else
1552 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1553 #endif
1554 
1555 /* PyFunctionFastCall.proto */
1556 #if CYTHON_FAST_PYCALL
1557 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1558  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1559 #if 1 || PY_VERSION_HEX < 0x030600B1
1560 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1561 #else
1562 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1563 #endif
1564 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1565  (sizeof(char [1 - 2*!(cond)]) - 1)
1566 #ifndef Py_MEMBER_SIZE
1567 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1568 #endif
1569  static size_t __pyx_pyframe_localsplus_offset = 0;
1570  #include "frameobject.h"
1571  #define __Pxy_PyFrame_Initialize_Offsets()\
1572  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1573  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1574  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1575  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1576 #endif
1577 
1578 /* PyObjectCall.proto */
1579 #if CYTHON_COMPILING_IN_CPYTHON
1580 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1581 #else
1582 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1583 #endif
1584 
1585 /* PyObjectCallMethO.proto */
1586 #if CYTHON_COMPILING_IN_CPYTHON
1587 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1588 #endif
1589 
1590 /* PyObjectCallOneArg.proto */
1591 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1592 
1593 /* ArgTypeTest.proto */
1594 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1595  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1596  __Pyx__ArgTypeTest(obj, type, name, exact))
1597 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1598 
1599 /* PyThreadStateGet.proto */
1600 #if CYTHON_FAST_THREAD_STATE
1601 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1602 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1603 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1604 #else
1605 #define __Pyx_PyThreadState_declare
1606 #define __Pyx_PyThreadState_assign
1607 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1608 #endif
1609 
1610 /* PyErrFetchRestore.proto */
1611 #if CYTHON_FAST_THREAD_STATE
1612 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1613 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1614 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1615 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1616 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1617 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1618 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1619 #if CYTHON_COMPILING_IN_CPYTHON
1620 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1621 #else
1622 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1623 #endif
1624 #else
1625 #define __Pyx_PyErr_Clear() PyErr_Clear()
1626 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1627 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1628 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1629 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1630 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1631 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1632 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1633 #endif
1634 
1635 /* RaiseException.proto */
1636 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1637 
1638 /* ExtTypeTest.proto */
1639 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1640 
1641 /* MemviewSliceInit.proto */
1642 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1643 #define __Pyx_MEMVIEW_DIRECT 1
1644 #define __Pyx_MEMVIEW_PTR 2
1645 #define __Pyx_MEMVIEW_FULL 4
1646 #define __Pyx_MEMVIEW_CONTIG 8
1647 #define __Pyx_MEMVIEW_STRIDED 16
1648 #define __Pyx_MEMVIEW_FOLLOW 32
1649 #define __Pyx_IS_C_CONTIG 1
1650 #define __Pyx_IS_F_CONTIG 2
1651 static int __Pyx_init_memviewslice(
1652  struct __pyx_memoryview_obj *memview,
1653  int ndim,
1654  __Pyx_memviewslice *memviewslice,
1655  int memview_is_new_reference);
1656 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1657  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1658 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1659  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1660 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1661 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1662 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1663 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1664 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1665 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1666 
1667 /* BufferIndexError.proto */
1668 static void __Pyx_RaiseBufferIndexError(int axis);
1669 
1670 /* WriteUnraisableException.proto */
1671 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1672  int lineno, const char *filename,
1673  int full_traceback, int nogil);
1674 
1675 /* DictGetItem.proto */
1676 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1677 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1678 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1679  (likely(PyDict_CheckExact(obj)) ?\
1680  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1681 #else
1682 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1683 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1684 #endif
1685 
1686 /* RaiseTooManyValuesToUnpack.proto */
1687 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1688 
1689 /* RaiseNeedMoreValuesToUnpack.proto */
1690 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1691 
1692 /* RaiseNoneIterError.proto */
1693 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1694 
1695 /* GetTopmostException.proto */
1696 #if CYTHON_USE_EXC_INFO_STACK
1697 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1698 #endif
1699 
1700 /* SaveResetException.proto */
1701 #if CYTHON_FAST_THREAD_STATE
1702 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1703 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1704 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1705 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1706 #else
1707 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1708 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1709 #endif
1710 
1711 /* PyErrExceptionMatches.proto */
1712 #if CYTHON_FAST_THREAD_STATE
1713 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1714 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1715 #else
1716 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1717 #endif
1718 
1719 /* GetException.proto */
1720 #if CYTHON_FAST_THREAD_STATE
1721 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1722 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1723 #else
1724 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1725 #endif
1726 
1727 /* PyObjectCall2Args.proto */
1728 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1729 
1730 /* IncludeStringH.proto */
1731 #include <string.h>
1732 
1733 /* BytesEquals.proto */
1734 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1735 
1736 /* UnicodeEquals.proto */
1737 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1738 
1739 /* StrEquals.proto */
1740 #if PY_MAJOR_VERSION >= 3
1741 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1742 #else
1743 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1744 #endif
1745 
1746 /* None.proto */
1747 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1748 
1749 /* UnaryNegOverflows.proto */
1750 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1751  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1752 
1753 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1754 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1755 /* GetAttr.proto */
1756 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1757 
1758 /* GetItemInt.proto */
1759 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1760  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1761  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1762  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1763  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1764 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1765  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1766  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1767  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1768 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1769  int wraparound, int boundscheck);
1770 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1771  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1772  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1773  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1774 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1775  int wraparound, int boundscheck);
1776 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1777 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1778  int is_list, int wraparound, int boundscheck);
1779 
1780 /* ObjectGetItem.proto */
1781 #if CYTHON_USE_TYPE_SLOTS
1782 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1783 #else
1784 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1785 #endif
1786 
1787 /* decode_c_string_utf16.proto */
1788 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1789  int byteorder = 0;
1790  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1791 }
1792 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1793  int byteorder = -1;
1794  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1795 }
1796 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1797  int byteorder = 1;
1798  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1799 }
1800 
1801 /* decode_c_string.proto */
1802 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1803  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1804  const char* encoding, const char* errors,
1805  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1806 
1807 /* GetAttr3.proto */
1808 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1809 
1810 /* PyDictVersioning.proto */
1811 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1812 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1813 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1814 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1815  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1816  (cache_var) = (value);
1817 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1818  static PY_UINT64_T __pyx_dict_version = 0;\
1819  static PyObject *__pyx_dict_cached_value = NULL;\
1820  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1821  (VAR) = __pyx_dict_cached_value;\
1822  } else {\
1823  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1824  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1825  }\
1826 }
1827 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1828 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1829 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1830 #else
1831 #define __PYX_GET_DICT_VERSION(dict) (0)
1832 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1833 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1834 #endif
1835 
1836 /* GetModuleGlobalName.proto */
1837 #if CYTHON_USE_DICT_VERSIONS
1838 #define __Pyx_GetModuleGlobalName(var, name) {\
1839  static PY_UINT64_T __pyx_dict_version = 0;\
1840  static PyObject *__pyx_dict_cached_value = NULL;\
1841  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1842  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1843  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1844 }
1845 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1846  PY_UINT64_T __pyx_dict_version;\
1847  PyObject *__pyx_dict_cached_value;\
1848  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1849 }
1850 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1851 #else
1852 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1853 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1854 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1855 #endif
1856 
1857 /* SwapException.proto */
1858 #if CYTHON_FAST_THREAD_STATE
1859 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1860 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1861 #else
1862 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1863 #endif
1864 
1865 /* Import.proto */
1866 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1867 
1868 /* FastTypeChecks.proto */
1869 #if CYTHON_COMPILING_IN_CPYTHON
1870 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1871 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1872 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1873 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1874 #else
1875 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1876 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1877 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1878 #endif
1879 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1880 
1881 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1882 /* ListCompAppend.proto */
1883 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1884 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1885  PyListObject* L = (PyListObject*) list;
1886  Py_ssize_t len = Py_SIZE(list);
1887  if (likely(L->allocated > len)) {
1888  Py_INCREF(x);
1889  PyList_SET_ITEM(list, len, x);
1890  __Pyx_SET_SIZE(list, len + 1);
1891  return 0;
1892  }
1893  return PyList_Append(list, x);
1894 }
1895 #else
1896 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1897 #endif
1898 
1899 /* PyIntBinop.proto */
1900 #if !CYTHON_COMPILING_IN_PYPY
1901 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1902 #else
1903 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1904  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1905 #endif
1906 
1907 /* ListExtend.proto */
1908 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1909 #if CYTHON_COMPILING_IN_CPYTHON
1910  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1911  if (unlikely(!none))
1912  return -1;
1913  Py_DECREF(none);
1914  return 0;
1915 #else
1916  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1917 #endif
1918 }
1919 
1920 /* ListAppend.proto */
1921 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1922 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1923  PyListObject* L = (PyListObject*) list;
1924  Py_ssize_t len = Py_SIZE(list);
1925  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1926  Py_INCREF(x);
1927  PyList_SET_ITEM(list, len, x);
1928  __Pyx_SET_SIZE(list, len + 1);
1929  return 0;
1930  }
1931  return PyList_Append(list, x);
1932 }
1933 #else
1934 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1935 #endif
1936 
1937 /* None.proto */
1938 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1939 
1940 /* None.proto */
1941 static CYTHON_INLINE long __Pyx_div_long(long, long);
1942 
1943 /* ImportFrom.proto */
1944 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1945 
1946 /* HasAttr.proto */
1947 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1948 
1949 /* PyObject_GenericGetAttrNoDict.proto */
1950 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1951 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1952 #else
1953 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1954 #endif
1955 
1956 /* PyObject_GenericGetAttr.proto */
1957 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1958 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1959 #else
1960 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1961 #endif
1962 
1963 /* PyObjectGetAttrStrNoError.proto */
1964 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1965 
1966 /* SetupReduce.proto */
1967 static int __Pyx_setup_reduce(PyObject* type_obj);
1968 
1969 /* SetVTable.proto */
1970 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1971 
1972 /* TypeImport.proto */
1973 #ifndef __PYX_HAVE_RT_ImportType_proto
1974 #define __PYX_HAVE_RT_ImportType_proto
1975 enum __Pyx_ImportType_CheckSize {
1976  __Pyx_ImportType_CheckSize_Error = 0,
1977  __Pyx_ImportType_CheckSize_Warn = 1,
1978  __Pyx_ImportType_CheckSize_Ignore = 2
1979 };
1980 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1981 #endif
1982 
1983 /* CalculateMetaclass.proto */
1984 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1985 
1986 /* FetchCommonType.proto */
1987 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1988 
1989 /* CythonFunctionShared.proto */
1990 #define __Pyx_CyFunction_USED 1
1991 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1992 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1993 #define __Pyx_CYFUNCTION_CCLASS 0x04
1994 #define __Pyx_CyFunction_GetClosure(f)\
1995  (((__pyx_CyFunctionObject *) (f))->func_closure)
1996 #define __Pyx_CyFunction_GetClassObj(f)\
1997  (((__pyx_CyFunctionObject *) (f))->func_classobj)
1998 #define __Pyx_CyFunction_Defaults(type, f)\
1999  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2000 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2001  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2002 typedef struct {
2003  PyCFunctionObject func;
2004 #if PY_VERSION_HEX < 0x030500A0
2005  PyObject *func_weakreflist;
2006 #endif
2007  PyObject *func_dict;
2008  PyObject *func_name;
2009  PyObject *func_qualname;
2010  PyObject *func_doc;
2011  PyObject *func_globals;
2012  PyObject *func_code;
2013  PyObject *func_closure;
2014  PyObject *func_classobj;
2015  void *defaults;
2016  int defaults_pyobjects;
2017  size_t defaults_size; // used by FusedFunction for copying defaults
2018  int flags;
2019  PyObject *defaults_tuple;
2020  PyObject *defaults_kwdict;
2021  PyObject *(*defaults_getter)(PyObject *);
2022  PyObject *func_annotations;
2023 } __pyx_CyFunctionObject;
2024 static PyTypeObject *__pyx_CyFunctionType = 0;
2025 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2026 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2027  int flags, PyObject* qualname,
2028  PyObject *self,
2029  PyObject *module, PyObject *globals,
2030  PyObject* code);
2031 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2032  size_t size,
2033  int pyobjects);
2034 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2035  PyObject *tuple);
2036 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2037  PyObject *dict);
2038 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2039  PyObject *dict);
2040 static int __pyx_CyFunction_init(void);
2041 
2042 /* CythonFunction.proto */
2043 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2044  int flags, PyObject* qualname,
2045  PyObject *closure,
2046  PyObject *module, PyObject *globals,
2047  PyObject* code);
2048 
2049 /* SetNameInClass.proto */
2050 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2051 #define __Pyx_SetNameInClass(ns, name, value)\
2052  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2053 #elif CYTHON_COMPILING_IN_CPYTHON
2054 #define __Pyx_SetNameInClass(ns, name, value)\
2055  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2056 #else
2057 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2058 #endif
2059 
2060 /* Py3ClassCreate.proto */
2061 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2062  PyObject *mkw, PyObject *modname, PyObject *doc);
2063 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2064  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2065 
2066 /* CLineInTraceback.proto */
2067 #ifdef CYTHON_CLINE_IN_TRACEBACK
2068 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2069 #else
2070 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2071 #endif
2072 
2073 /* CodeObjectCache.proto */
2074 typedef struct {
2075  PyCodeObject* code_object;
2076  int code_line;
2077 } __Pyx_CodeObjectCacheEntry;
2078 struct __Pyx_CodeObjectCache {
2079  int count;
2080  int max_count;
2081  __Pyx_CodeObjectCacheEntry* entries;
2082 };
2083 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2084 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2085 static PyCodeObject *__pyx_find_code_object(int code_line);
2086 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2087 
2088 /* AddTraceback.proto */
2089 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2090  int py_line, const char *filename);
2091 
2092 #if PY_MAJOR_VERSION < 3
2093  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2094  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2095 #else
2096  #define __Pyx_GetBuffer PyObject_GetBuffer
2097  #define __Pyx_ReleaseBuffer PyBuffer_Release
2098 #endif
2099 
2100 
2101 /* BufferStructDeclare.proto */
2102 typedef struct {
2103  Py_ssize_t shape, strides, suboffsets;
2104 } __Pyx_Buf_DimInfo;
2105 typedef struct {
2106  size_t refcount;
2107  Py_buffer pybuffer;
2108 } __Pyx_Buffer;
2109 typedef struct {
2110  __Pyx_Buffer *rcbuffer;
2111  char *data;
2112  __Pyx_Buf_DimInfo diminfo[8];
2113 } __Pyx_LocalBuf_ND;
2114 
2115 /* MemviewSliceIsContig.proto */
2116 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2117 
2118 /* OverlappingSlices.proto */
2119 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2120  __Pyx_memviewslice *slice2,
2121  int ndim, size_t itemsize);
2122 
2123 /* Capsule.proto */
2124 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2125 
2126 /* RealImag.proto */
2127 #if CYTHON_CCOMPLEX
2128  #ifdef __cplusplus
2129  #define __Pyx_CREAL(z) ((z).real())
2130  #define __Pyx_CIMAG(z) ((z).imag())
2131  #else
2132  #define __Pyx_CREAL(z) (__real__(z))
2133  #define __Pyx_CIMAG(z) (__imag__(z))
2134  #endif
2135 #else
2136  #define __Pyx_CREAL(z) ((z).real)
2137  #define __Pyx_CIMAG(z) ((z).imag)
2138 #endif
2139 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2140  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2141  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2142  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2143 #else
2144  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2145  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2146 #endif
2147 
2148 /* Arithmetic.proto */
2149 #if CYTHON_CCOMPLEX
2150  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2151  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2152  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2153  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2154  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2155  #define __Pyx_c_neg_float(a) (-(a))
2156  #ifdef __cplusplus
2157  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2158  #define __Pyx_c_conj_float(z) (::std::conj(z))
2159  #if 1
2160  #define __Pyx_c_abs_float(z) (::std::abs(z))
2161  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2162  #endif
2163  #else
2164  #define __Pyx_c_is_zero_float(z) ((z)==0)
2165  #define __Pyx_c_conj_float(z) (conjf(z))
2166  #if 1
2167  #define __Pyx_c_abs_float(z) (cabsf(z))
2168  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2169  #endif
2170  #endif
2171 #else
2172  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2173  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2174  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2175  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2176  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2177  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2178  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2179  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2180  #if 1
2181  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2182  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2183  #endif
2184 #endif
2185 
2186 /* Arithmetic.proto */
2187 #if CYTHON_CCOMPLEX
2188  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2189  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2190  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2191  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2192  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2193  #define __Pyx_c_neg_double(a) (-(a))
2194  #ifdef __cplusplus
2195  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2196  #define __Pyx_c_conj_double(z) (::std::conj(z))
2197  #if 1
2198  #define __Pyx_c_abs_double(z) (::std::abs(z))
2199  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2200  #endif
2201  #else
2202  #define __Pyx_c_is_zero_double(z) ((z)==0)
2203  #define __Pyx_c_conj_double(z) (conj(z))
2204  #if 1
2205  #define __Pyx_c_abs_double(z) (cabs(z))
2206  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2207  #endif
2208  #endif
2209 #else
2210  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2211  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2212  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2213  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2214  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2215  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2216  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2217  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2218  #if 1
2219  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2220  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2221  #endif
2222 #endif
2223 
2224 /* CIntToPy.proto */
2225 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2226 
2227 /* CIntToPy.proto */
2228 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2229 
2230 /* MemviewSliceCopyTemplate.proto */
2231 static __Pyx_memviewslice
2232 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2233  const char *mode, int ndim,
2234  size_t sizeof_dtype, int contig_flag,
2235  int dtype_is_object);
2236 
2237 /* CIntFromPy.proto */
2238 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2239 
2240 /* CIntFromPy.proto */
2241 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2242 
2243 /* CIntToPy.proto */
2244 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2245 
2246 /* CIntFromPy.proto */
2247 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2248 
2249 /* IsLittleEndian.proto */
2250 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2251 
2252 /* BufferFormatCheck.proto */
2253 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2254 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2255  __Pyx_BufFmt_StackElem* stack,
2256  __Pyx_TypeInfo* type);
2257 
2258 /* TypeInfoCompare.proto */
2259 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2260 
2261 /* MemviewSliceValidateAndInit.proto */
2262 static int __Pyx_ValidateAndInit_memviewslice(
2263  int *axes_specs,
2264  int c_or_f_flag,
2265  int buf_flags,
2266  int ndim,
2267  __Pyx_TypeInfo *dtype,
2268  __Pyx_BufFmt_StackElem stack[],
2269  __Pyx_memviewslice *memviewslice,
2270  PyObject *original_obj);
2271 
2272 /* ObjectToMemviewSlice.proto */
2273 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2274 
2275 /* ObjectToMemviewSlice.proto */
2276 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2277 
2278 /* CheckBinaryVersion.proto */
2279 static int __Pyx_check_binary_version(void);
2280 
2281 /* InitStrings.proto */
2282 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2283 
2284 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2285 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2286 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2287 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2288 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2289 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2290 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2291 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2292 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2293 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2294 
2295 /* Module declarations from 'proteus' */
2296 
2297 /* Module declarations from 'cpython.buffer' */
2298 
2299 /* Module declarations from 'libc.string' */
2300 
2301 /* Module declarations from 'libc.stdio' */
2302 
2303 /* Module declarations from '__builtin__' */
2304 
2305 /* Module declarations from 'cpython.type' */
2306 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2307 
2308 /* Module declarations from 'cpython' */
2309 
2310 /* Module declarations from 'cpython.object' */
2311 
2312 /* Module declarations from 'cpython.ref' */
2313 
2314 /* Module declarations from 'cpython.mem' */
2315 
2316 /* Module declarations from 'numpy' */
2317 
2318 /* Module declarations from 'numpy' */
2319 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2320 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2321 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2322 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2323 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2324 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2325 
2326 /* Module declarations from 'proteus.superluWrappers' */
2327 static PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = 0;
2328 
2329 /* Module declarations from 'cython.view' */
2330 
2331 /* Module declarations from 'cython' */
2332 
2333 /* Module declarations from 'csmoothers' */
2334 static PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor = 0;
2335 static PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor = 0;
2336 static PyTypeObject *__pyx_array_type = 0;
2337 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2338 static PyTypeObject *__pyx_memoryview_type = 0;
2339 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2340 static PyObject *generic = 0;
2341 static PyObject *strided = 0;
2342 static PyObject *indirect = 0;
2343 static PyObject *contiguous = 0;
2344 static PyObject *indirect_contiguous = 0;
2345 static int __pyx_memoryview_thread_locks_used;
2346 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2347 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2348 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2349 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2350 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2351 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2352 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2353 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cASMFactor *); /*proto*/
2354 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2355 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cBASMFactor *); /*proto*/
2356 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2357 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2358 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2359 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2360 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2361 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2362 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2363 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2364 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2365 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2366 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2367 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2368 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2369 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2370 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2371 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2372 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2373 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2374 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2375 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2376 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2377 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2378 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2379 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2380 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2381 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2382 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2383 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2384 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2385 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2386 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2387 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2388 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2389 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2390 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2391 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2392 #define __Pyx_MODULE_NAME "csmoothers"
2393 extern int __pyx_module_is_main_csmoothers;
2394 int __pyx_module_is_main_csmoothers = 0;
2395 
2396 /* Implementation of 'csmoothers' */
2397 static PyObject *__pyx_builtin_object;
2398 static PyObject *__pyx_builtin_TypeError;
2399 static PyObject *__pyx_builtin_RuntimeError;
2400 static PyObject *__pyx_builtin_ValueError;
2401 static PyObject *__pyx_builtin_ImportError;
2402 static PyObject *__pyx_builtin_MemoryError;
2403 static PyObject *__pyx_builtin_enumerate;
2404 static PyObject *__pyx_builtin_range;
2405 static PyObject *__pyx_builtin_Ellipsis;
2406 static PyObject *__pyx_builtin_id;
2407 static PyObject *__pyx_builtin_IndexError;
2408 static const char __pyx_k_A[] = "A";
2409 static const char __pyx_k_L[] = "L";
2410 static const char __pyx_k_M[] = "M";
2411 static const char __pyx_k_O[] = "O";
2412 static const char __pyx_k_R[] = "R";
2413 static const char __pyx_k_c[] = "c";
2414 static const char __pyx_k_w[] = "w";
2415 static const char __pyx_k_bs[] = "bs";
2416 static const char __pyx_k_dX[] = "dX";
2417 static const char __pyx_k_id[] = "id";
2418 static const char __pyx_k_nc[] = "nc";
2419 static const char __pyx_k_np[] = "np";
2420 static const char __pyx_k_nr[] = "nr";
2421 static const char __pyx_k_doc[] = "__doc__";
2422 static const char __pyx_k_new[] = "__new__";
2423 static const char __pyx_k_obj[] = "obj";
2424 static const char __pyx_k_tol[] = "tol";
2425 static const char __pyx_k_base[] = "base";
2426 static const char __pyx_k_dict[] = "__dict__";
2427 static const char __pyx_k_init[] = "__init__";
2428 static const char __pyx_k_main[] = "__main__";
2429 static const char __pyx_k_mode[] = "mode";
2430 static const char __pyx_k_name[] = "name";
2431 static const char __pyx_k_ndim[] = "ndim";
2432 static const char __pyx_k_pack[] = "pack";
2433 static const char __pyx_k_self[] = "self";
2434 static const char __pyx_k_size[] = "size";
2435 static const char __pyx_k_step[] = "step";
2436 static const char __pyx_k_stop[] = "stop";
2437 static const char __pyx_k_test[] = "__test__";
2438 static const char __pyx_k_ASCII[] = "ASCII";
2439 static const char __pyx_k_class[] = "__class__";
2440 static const char __pyx_k_error[] = "error";
2441 static const char __pyx_k_flags[] = "flags";
2442 static const char __pyx_k_numpy[] = "numpy";
2443 static const char __pyx_k_range[] = "range";
2444 static const char __pyx_k_shape[] = "shape";
2445 static const char __pyx_k_start[] = "start";
2446 static const char __pyx_k_encode[] = "encode";
2447 static const char __pyx_k_format[] = "format";
2448 static const char __pyx_k_import[] = "__import__";
2449 static const char __pyx_k_module[] = "__module__";
2450 static const char __pyx_k_name_2[] = "__name__";
2451 static const char __pyx_k_object[] = "object";
2452 static const char __pyx_k_pickle[] = "pickle";
2453 static const char __pyx_k_reduce[] = "__reduce__";
2454 static const char __pyx_k_struct[] = "struct";
2455 static const char __pyx_k_unpack[] = "unpack";
2456 static const char __pyx_k_update[] = "update";
2457 static const char __pyx_k_fortran[] = "fortran";
2458 static const char __pyx_k_memview[] = "memview";
2459 static const char __pyx_k_prepare[] = "__prepare__";
2460 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2461 static const char __pyx_k_getstate[] = "__getstate__";
2462 static const char __pyx_k_itemsize[] = "itemsize";
2463 static const char __pyx_k_pyx_type[] = "__pyx_type";
2464 static const char __pyx_k_qualname[] = "__qualname__";
2465 static const char __pyx_k_setstate[] = "__setstate__";
2466 static const char __pyx_k_ASMFactor[] = "ASMFactor";
2467 static const char __pyx_k_TypeError[] = "TypeError";
2468 static const char __pyx_k_asmFactor[] = "asmFactor";
2469 static const char __pyx_k_enumerate[] = "enumerate";
2470 static const char __pyx_k_metaclass[] = "__metaclass__";
2471 static const char __pyx_k_pyx_state[] = "__pyx_state";
2472 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2473 static const char __pyx_k_BASMFactor[] = "BASMFactor";
2474 static const char __pyx_k_IndexError[] = "IndexError";
2475 static const char __pyx_k_ValueError[] = "ValueError";
2476 static const char __pyx_k_basmFactor[] = "basmFactor";
2477 static const char __pyx_k_cASMFactor[] = "_cASMFactor";
2478 static const char __pyx_k_csmoothers[] = "csmoothers";
2479 static const char __pyx_k_node_order[] = "node_order";
2480 static const char __pyx_k_pyx_result[] = "__pyx_result";
2481 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2482 static const char __pyx_k_ImportError[] = "ImportError";
2483 static const char __pyx_k_MemoryError[] = "MemoryError";
2484 static const char __pyx_k_PickleError[] = "PickleError";
2485 static const char __pyx_k_cBASMFactor[] = "_cBASMFactor";
2486 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2487 static const char __pyx_k_asm_NR_solve[] = "asm_NR_solve";
2488 static const char __pyx_k_cASMFactor_2[] = "cASMFactor";
2489 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2490 static const char __pyx_k_stringsource[] = "stringsource";
2491 static const char __pyx_k_basm_NR_solve[] = "basm_NR_solve";
2492 static const char __pyx_k_cBASMFactor_2[] = "cBASMFactor";
2493 static const char __pyx_k_cSparseMatrix[] = "_cSparseMatrix";
2494 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2495 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2496 static const char __pyx_k_asm_NR_prepare[] = "asm_NR_prepare";
2497 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2498 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2499 static const char __pyx_k_basm_NR_prepare[] = "basm_NR_prepare";
2500 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2501 static const char __pyx_k_jacobi_NR_solve[] = "jacobi_NR_solve";
2502 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2503 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2504 static const char __pyx_k_ASMFactor___init[] = "ASMFactor.__init__";
2505 static const char __pyx_k_BASMFactor___init[] = "BASMFactor.__init__";
2506 static const char __pyx_k_jacobi_NR_prepare[] = "jacobi_NR_prepare";
2507 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2508 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2509 static const char __pyx_k_nl_jacobi_NR_solve[] = "nl_jacobi_NR_solve";
2510 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2511 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2512 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2513 static const char __pyx_k_gauss_seidel_NR_solve[] = "gauss_seidel_NR_solve";
2514 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2515 static const char __pyx_k_gauss_seidel_NR_preare[] = "gauss_seidel_NR_preare";
2516 static const char __pyx_k_proteus_csmoothers_pyx[] = "proteus/csmoothers.pyx";
2517 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2518 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2519 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2520 static const char __pyx_k_nl_gauss_seidel_NR_solve[] = "nl_gauss_seidel_NR_solve";
2521 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2522 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2523 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2524 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2525 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2526 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2527 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2528 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2529 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2530 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2531 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2532 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2533 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2534 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2535 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2536 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2537 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2538 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2539 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2540 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2541 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2542 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2543 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2544 static PyObject *__pyx_n_s_A;
2545 static PyObject *__pyx_n_s_ASCII;
2546 static PyObject *__pyx_n_s_ASMFactor;
2547 static PyObject *__pyx_n_s_ASMFactor___init;
2548 static PyObject *__pyx_n_s_BASMFactor;
2549 static PyObject *__pyx_n_s_BASMFactor___init;
2550 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2551 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2552 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2553 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2554 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2555 static PyObject *__pyx_n_s_Ellipsis;
2556 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2557 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2558 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2559 static PyObject *__pyx_n_s_ImportError;
2560 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2561 static PyObject *__pyx_n_s_IndexError;
2562 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2563 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2564 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2565 static PyObject *__pyx_n_s_L;
2566 static PyObject *__pyx_n_s_M;
2567 static PyObject *__pyx_n_s_MemoryError;
2568 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2569 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2570 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2571 static PyObject *__pyx_n_b_O;
2572 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2573 static PyObject *__pyx_n_s_PickleError;
2574 static PyObject *__pyx_n_s_R;
2575 static PyObject *__pyx_n_s_RuntimeError;
2576 static PyObject *__pyx_n_s_TypeError;
2577 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2578 static PyObject *__pyx_n_s_ValueError;
2579 static PyObject *__pyx_n_s_View_MemoryView;
2580 static PyObject *__pyx_n_s_allocate_buffer;
2581 static PyObject *__pyx_n_s_asmFactor;
2582 static PyObject *__pyx_n_s_asm_NR_prepare;
2583 static PyObject *__pyx_n_s_asm_NR_solve;
2584 static PyObject *__pyx_n_s_base;
2585 static PyObject *__pyx_n_s_basmFactor;
2586 static PyObject *__pyx_n_s_basm_NR_prepare;
2587 static PyObject *__pyx_n_s_basm_NR_solve;
2588 static PyObject *__pyx_n_s_bs;
2589 static PyObject *__pyx_n_s_c;
2590 static PyObject *__pyx_n_u_c;
2591 static PyObject *__pyx_n_s_cASMFactor;
2592 static PyObject *__pyx_n_s_cASMFactor_2;
2593 static PyObject *__pyx_n_s_cBASMFactor;
2594 static PyObject *__pyx_n_s_cBASMFactor_2;
2595 static PyObject *__pyx_n_s_cSparseMatrix;
2596 static PyObject *__pyx_n_s_class;
2597 static PyObject *__pyx_n_s_cline_in_traceback;
2598 static PyObject *__pyx_kp_s_contiguous_and_direct;
2599 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2600 static PyObject *__pyx_n_s_csmoothers;
2601 static PyObject *__pyx_n_s_dX;
2602 static PyObject *__pyx_n_s_dict;
2603 static PyObject *__pyx_n_s_doc;
2604 static PyObject *__pyx_n_s_dtype_is_object;
2605 static PyObject *__pyx_n_s_encode;
2606 static PyObject *__pyx_n_s_enumerate;
2607 static PyObject *__pyx_n_s_error;
2608 static PyObject *__pyx_n_s_flags;
2609 static PyObject *__pyx_n_s_format;
2610 static PyObject *__pyx_n_s_fortran;
2611 static PyObject *__pyx_n_u_fortran;
2612 static PyObject *__pyx_n_s_gauss_seidel_NR_preare;
2613 static PyObject *__pyx_n_s_gauss_seidel_NR_solve;
2614 static PyObject *__pyx_n_s_getstate;
2615 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2616 static PyObject *__pyx_n_s_id;
2617 static PyObject *__pyx_n_s_import;
2618 static PyObject *__pyx_n_s_init;
2619 static PyObject *__pyx_n_s_itemsize;
2620 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2621 static PyObject *__pyx_n_s_jacobi_NR_prepare;
2622 static PyObject *__pyx_n_s_jacobi_NR_solve;
2623 static PyObject *__pyx_n_s_main;
2624 static PyObject *__pyx_n_s_memview;
2625 static PyObject *__pyx_n_s_metaclass;
2626 static PyObject *__pyx_n_s_mode;
2627 static PyObject *__pyx_n_s_module;
2628 static PyObject *__pyx_n_s_name;
2629 static PyObject *__pyx_n_s_name_2;
2630 static PyObject *__pyx_n_s_nc;
2631 static PyObject *__pyx_n_s_ndim;
2632 static PyObject *__pyx_n_s_new;
2633 static PyObject *__pyx_n_s_nl_gauss_seidel_NR_solve;
2634 static PyObject *__pyx_n_s_nl_jacobi_NR_solve;
2635 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2636 static PyObject *__pyx_n_s_node_order;
2637 static PyObject *__pyx_n_s_np;
2638 static PyObject *__pyx_n_s_nr;
2639 static PyObject *__pyx_n_s_numpy;
2640 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2641 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2642 static PyObject *__pyx_n_s_obj;
2643 static PyObject *__pyx_n_s_object;
2644 static PyObject *__pyx_n_s_pack;
2645 static PyObject *__pyx_n_s_pickle;
2646 static PyObject *__pyx_n_s_prepare;
2647 static PyObject *__pyx_kp_s_proteus_csmoothers_pyx;
2648 static PyObject *__pyx_n_s_pyx_PickleError;
2649 static PyObject *__pyx_n_s_pyx_checksum;
2650 static PyObject *__pyx_n_s_pyx_getbuffer;
2651 static PyObject *__pyx_n_s_pyx_result;
2652 static PyObject *__pyx_n_s_pyx_state;
2653 static PyObject *__pyx_n_s_pyx_type;
2654 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2655 static PyObject *__pyx_n_s_pyx_vtable;
2656 static PyObject *__pyx_n_s_qualname;
2657 static PyObject *__pyx_n_s_range;
2658 static PyObject *__pyx_n_s_reduce;
2659 static PyObject *__pyx_n_s_reduce_cython;
2660 static PyObject *__pyx_n_s_reduce_ex;
2661 static PyObject *__pyx_n_s_self;
2662 static PyObject *__pyx_n_s_setstate;
2663 static PyObject *__pyx_n_s_setstate_cython;
2664 static PyObject *__pyx_n_s_shape;
2665 static PyObject *__pyx_n_s_size;
2666 static PyObject *__pyx_n_s_start;
2667 static PyObject *__pyx_n_s_step;
2668 static PyObject *__pyx_n_s_stop;
2669 static PyObject *__pyx_kp_s_strided_and_direct;
2670 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2671 static PyObject *__pyx_kp_s_strided_and_indirect;
2672 static PyObject *__pyx_kp_s_stringsource;
2673 static PyObject *__pyx_n_s_struct;
2674 static PyObject *__pyx_n_s_test;
2675 static PyObject *__pyx_n_s_tol;
2676 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2677 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2678 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2679 static PyObject *__pyx_n_s_unpack;
2680 static PyObject *__pyx_n_s_update;
2681 static PyObject *__pyx_n_s_w;
2682 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L); /* proto */
2683 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L); /* proto */
2684 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
2685 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
2686 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2687 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs); /* proto */
2688 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs); /* proto */
2689 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
2690 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
2691 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2692 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
2693 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
2694 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
2695 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
2696 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
2697 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
2698 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor); /* proto */
2699 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
2700 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor); /* proto */
2701 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
2702 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2703 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2704 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2705 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2706 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2707 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2708 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2709 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2710 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2711 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2712 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2713 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2714 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2715 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2716 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2717 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2718 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2719 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2720 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2721 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2722 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2723 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2724 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2725 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2726 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2727 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2728 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2729 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2730 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2731 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2732 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2733 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2734 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2735 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2736 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2737 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2738 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2739 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2740 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2741 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2742 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2743 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2744 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2745 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2746 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2747 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2748 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2749 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2750 static PyObject *__pyx_int_0;
2751 static PyObject *__pyx_int_1;
2752 static PyObject *__pyx_int_184977713;
2753 static PyObject *__pyx_int_neg_1;
2754 static PyObject *__pyx_tuple_;
2755 static PyObject *__pyx_tuple__2;
2756 static PyObject *__pyx_tuple__3;
2757 static PyObject *__pyx_tuple__4;
2758 static PyObject *__pyx_tuple__5;
2759 static PyObject *__pyx_tuple__6;
2760 static PyObject *__pyx_tuple__7;
2761 static PyObject *__pyx_tuple__8;
2762 static PyObject *__pyx_tuple__9;
2763 static PyObject *__pyx_slice__24;
2764 static PyObject *__pyx_tuple__10;
2765 static PyObject *__pyx_tuple__11;
2766 static PyObject *__pyx_tuple__12;
2767 static PyObject *__pyx_tuple__13;
2768 static PyObject *__pyx_tuple__14;
2769 static PyObject *__pyx_tuple__15;
2770 static PyObject *__pyx_tuple__16;
2771 static PyObject *__pyx_tuple__17;
2772 static PyObject *__pyx_tuple__18;
2773 static PyObject *__pyx_tuple__19;
2774 static PyObject *__pyx_tuple__20;
2775 static PyObject *__pyx_tuple__21;
2776 static PyObject *__pyx_tuple__22;
2777 static PyObject *__pyx_tuple__23;
2778 static PyObject *__pyx_tuple__25;
2779 static PyObject *__pyx_tuple__26;
2780 static PyObject *__pyx_tuple__27;
2781 static PyObject *__pyx_tuple__28;
2782 static PyObject *__pyx_tuple__29;
2783 static PyObject *__pyx_tuple__31;
2784 static PyObject *__pyx_tuple__32;
2785 static PyObject *__pyx_tuple__34;
2786 static PyObject *__pyx_tuple__36;
2787 static PyObject *__pyx_tuple__38;
2788 static PyObject *__pyx_tuple__40;
2789 static PyObject *__pyx_tuple__42;
2790 static PyObject *__pyx_tuple__44;
2791 static PyObject *__pyx_tuple__46;
2792 static PyObject *__pyx_tuple__48;
2793 static PyObject *__pyx_tuple__50;
2794 static PyObject *__pyx_tuple__52;
2795 static PyObject *__pyx_tuple__54;
2796 static PyObject *__pyx_tuple__55;
2797 static PyObject *__pyx_tuple__56;
2798 static PyObject *__pyx_tuple__57;
2799 static PyObject *__pyx_tuple__58;
2800 static PyObject *__pyx_tuple__59;
2801 static PyObject *__pyx_codeobj__30;
2802 static PyObject *__pyx_codeobj__33;
2803 static PyObject *__pyx_codeobj__35;
2804 static PyObject *__pyx_codeobj__37;
2805 static PyObject *__pyx_codeobj__39;
2806 static PyObject *__pyx_codeobj__41;
2807 static PyObject *__pyx_codeobj__43;
2808 static PyObject *__pyx_codeobj__45;
2809 static PyObject *__pyx_codeobj__47;
2810 static PyObject *__pyx_codeobj__49;
2811 static PyObject *__pyx_codeobj__51;
2812 static PyObject *__pyx_codeobj__53;
2813 static PyObject *__pyx_codeobj__60;
2814 /* Late includes */
2815 
2816 /* "csmoothers.pyx":7
2817  * class ASMFactor(object):
2818  *
2819  * def __init__(self, L): # <<<<<<<<<<<<<<
2820  * self.L = L
2821  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2822  */
2823 
2824 /* Python wrapper */
2825 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2826 static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9ASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2827 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2828  PyObject *__pyx_v_self = 0;
2829  PyObject *__pyx_v_L = 0;
2830  int __pyx_lineno = 0;
2831  const char *__pyx_filename = NULL;
2832  int __pyx_clineno = 0;
2833  PyObject *__pyx_r = 0;
2834  __Pyx_RefNannyDeclarations
2835  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2836  {
2837  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,0};
2838  PyObject* values[2] = {0,0};
2839  if (unlikely(__pyx_kwds)) {
2840  Py_ssize_t kw_args;
2841  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2842  switch (pos_args) {
2843  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2844  CYTHON_FALLTHROUGH;
2845  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2846  CYTHON_FALLTHROUGH;
2847  case 0: break;
2848  default: goto __pyx_L5_argtuple_error;
2849  }
2850  kw_args = PyDict_Size(__pyx_kwds);
2851  switch (pos_args) {
2852  case 0:
2853  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2854  else goto __pyx_L5_argtuple_error;
2855  CYTHON_FALLTHROUGH;
2856  case 1:
2857  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2858  else {
2859  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 7, __pyx_L3_error)
2860  }
2861  }
2862  if (unlikely(kw_args > 0)) {
2863  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
2864  }
2865  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2866  goto __pyx_L5_argtuple_error;
2867  } else {
2868  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2869  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2870  }
2871  __pyx_v_self = values[0];
2872  __pyx_v_L = values[1];
2873  }
2874  goto __pyx_L4_argument_unpacking_done;
2875  __pyx_L5_argtuple_error:;
2876  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7, __pyx_L3_error)
2877  __pyx_L3_error:;
2878  __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2879  __Pyx_RefNannyFinishContext();
2880  return NULL;
2881  __pyx_L4_argument_unpacking_done:;
2882  __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
2883 
2884  /* function exit code */
2885  __Pyx_RefNannyFinishContext();
2886  return __pyx_r;
2887 }
2888 
2889 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
2890  PyObject *__pyx_r = NULL;
2891  __Pyx_RefNannyDeclarations
2892  PyObject *__pyx_t_1 = NULL;
2893  PyObject *__pyx_t_2 = NULL;
2894  int __pyx_lineno = 0;
2895  const char *__pyx_filename = NULL;
2896  int __pyx_clineno = 0;
2897  __Pyx_RefNannySetupContext("__init__", 0);
2898 
2899  /* "csmoothers.pyx":8
2900  *
2901  * def __init__(self, L):
2902  * self.L = L # <<<<<<<<<<<<<<
2903  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2904  *
2905  */
2906  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
2907 
2908  /* "csmoothers.pyx":9
2909  * def __init__(self, L):
2910  * self.L = L
2911  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix) # <<<<<<<<<<<<<<
2912  *
2913  * cdef class cASMFactor(object):
2914  */
2915  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2916  __Pyx_GOTREF(__pyx_t_1);
2917  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
2918  __Pyx_GOTREF(__pyx_t_2);
2919  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2920  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_10csmoothers_cASMFactor), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2921  __Pyx_GOTREF(__pyx_t_1);
2922  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2923  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
2924  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2925 
2926  /* "csmoothers.pyx":7
2927  * class ASMFactor(object):
2928  *
2929  * def __init__(self, L): # <<<<<<<<<<<<<<
2930  * self.L = L
2931  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2932  */
2933 
2934  /* function exit code */
2935  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2936  goto __pyx_L0;
2937  __pyx_L1_error:;
2938  __Pyx_XDECREF(__pyx_t_1);
2939  __Pyx_XDECREF(__pyx_t_2);
2940  __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2941  __pyx_r = NULL;
2942  __pyx_L0:;
2943  __Pyx_XGIVEREF(__pyx_r);
2944  __Pyx_RefNannyFinishContext();
2945  return __pyx_r;
2946 }
2947 
2948 /* "csmoothers.pyx":13
2949  * cdef class cASMFactor(object):
2950  *
2951  * def __cinit__(self, # <<<<<<<<<<<<<<
2952  * superluWrappers.cSparseMatrix L):
2953  * cdef int rval = 0
2954  */
2955 
2956 /* Python wrapper */
2957 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2958 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2959  struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
2960  int __pyx_lineno = 0;
2961  const char *__pyx_filename = NULL;
2962  int __pyx_clineno = 0;
2963  int __pyx_r;
2964  __Pyx_RefNannyDeclarations
2965  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2966  {
2967  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,0};
2968  PyObject* values[1] = {0};
2969  if (unlikely(__pyx_kwds)) {
2970  Py_ssize_t kw_args;
2971  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2972  switch (pos_args) {
2973  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2974  CYTHON_FALLTHROUGH;
2975  case 0: break;
2976  default: goto __pyx_L5_argtuple_error;
2977  }
2978  kw_args = PyDict_Size(__pyx_kwds);
2979  switch (pos_args) {
2980  case 0:
2981  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2982  else goto __pyx_L5_argtuple_error;
2983  }
2984  if (unlikely(kw_args > 0)) {
2985  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
2986  }
2987  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2988  goto __pyx_L5_argtuple_error;
2989  } else {
2990  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2991  }
2992  __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
2993  }
2994  goto __pyx_L4_argument_unpacking_done;
2995  __pyx_L5_argtuple_error:;
2996  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
2997  __pyx_L3_error:;
2998  __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2999  __Pyx_RefNannyFinishContext();
3000  return -1;
3001  __pyx_L4_argument_unpacking_done:;
3002  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
3003  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
3004 
3005  /* function exit code */
3006  goto __pyx_L0;
3007  __pyx_L1_error:;
3008  __pyx_r = -1;
3009  __pyx_L0:;
3010  __Pyx_RefNannyFinishContext();
3011  return __pyx_r;
3012 }
3013 
3014 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
3015  int __pyx_v_rval;
3016  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3017  int __pyx_r;
3018  __Pyx_RefNannyDeclarations
3019  PyObject *__pyx_t_1 = NULL;
3020  int __pyx_t_2;
3021  int __pyx_lineno = 0;
3022  const char *__pyx_filename = NULL;
3023  int __pyx_clineno = 0;
3024  __Pyx_RefNannySetupContext("__cinit__", 0);
3025 
3026  /* "csmoothers.pyx":15
3027  * def __cinit__(self,
3028  * superluWrappers.cSparseMatrix L):
3029  * cdef int rval = 0 # <<<<<<<<<<<<<<
3030  * cdef SuperMatrix AS
3031  * AS.Stype = superluWrappers._SLU_NR
3032  */
3033  __pyx_v_rval = 0;
3034 
3035  /* "csmoothers.pyx":17
3036  * cdef int rval = 0
3037  * cdef SuperMatrix AS
3038  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3039  * AS.Dtype = superluWrappers._SLU_D
3040  * AS.Mtype = superluWrappers._SLU_GE
3041  */
3042  __pyx_v_AS.Stype = SLU_NR;
3043 
3044  /* "csmoothers.pyx":18
3045  * cdef SuperMatrix AS
3046  * AS.Stype = superluWrappers._SLU_NR
3047  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3048  * AS.Mtype = superluWrappers._SLU_GE
3049  * AS.nrow = L.nr
3050  */
3051  __pyx_v_AS.Dtype = SLU_D;
3052 
3053  /* "csmoothers.pyx":19
3054  * AS.Stype = superluWrappers._SLU_NR
3055  * AS.Dtype = superluWrappers._SLU_D
3056  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3057  * AS.nrow = L.nr
3058  * AS.ncol = L.nc
3059  */
3060  __pyx_v_AS.Mtype = SLU_GE;
3061 
3062  /* "csmoothers.pyx":20
3063  * AS.Dtype = superluWrappers._SLU_D
3064  * AS.Mtype = superluWrappers._SLU_GE
3065  * AS.nrow = L.nr # <<<<<<<<<<<<<<
3066  * AS.ncol = L.nc
3067  * AS.Store = &L.A
3068  */
3069  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
3070  __Pyx_GOTREF(__pyx_t_1);
3071  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
3072  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3073  __pyx_v_AS.nrow = __pyx_t_2;
3074 
3075  /* "csmoothers.pyx":21
3076  * AS.Mtype = superluWrappers._SLU_GE
3077  * AS.nrow = L.nr
3078  * AS.ncol = L.nc # <<<<<<<<<<<<<<
3079  * AS.Store = &L.A
3080  * rval = casm_NR_init(&AS,
3081  */
3082  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
3083  __Pyx_GOTREF(__pyx_t_1);
3084  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
3085  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3086  __pyx_v_AS.ncol = __pyx_t_2;
3087 
3088  /* "csmoothers.pyx":22
3089  * AS.nrow = L.nr
3090  * AS.ncol = L.nc
3091  * AS.Store = &L.A # <<<<<<<<<<<<<<
3092  * rval = casm_NR_init(&AS,
3093  * &self.subdomain_dim,
3094  */
3095  __pyx_v_AS.Store = (&__pyx_v_L->A);
3096 
3097  /* "csmoothers.pyx":23
3098  * AS.ncol = L.nc
3099  * AS.Store = &L.A
3100  * rval = casm_NR_init(&AS, # <<<<<<<<<<<<<<
3101  * &self.subdomain_dim,
3102  * &self.l2g_L,
3103  */
3104  __pyx_v_rval = asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
3105 
3106  /* "csmoothers.pyx":30
3107  * &self.subdomain_dX,
3108  * &self.subdomain_pivots)
3109  * assert rval == 0 # <<<<<<<<<<<<<<
3110  *
3111  * def __dealloc__(self):
3112  */
3113  #ifndef CYTHON_WITHOUT_ASSERTIONS
3114  if (unlikely(!Py_OptimizeFlag)) {
3115  if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3116  PyErr_SetNone(PyExc_AssertionError);
3117  __PYX_ERR(0, 30, __pyx_L1_error)
3118  }
3119  }
3120  #endif
3121 
3122  /* "csmoothers.pyx":13
3123  * cdef class cASMFactor(object):
3124  *
3125  * def __cinit__(self, # <<<<<<<<<<<<<<
3126  * superluWrappers.cSparseMatrix L):
3127  * cdef int rval = 0
3128  */
3129 
3130  /* function exit code */
3131  __pyx_r = 0;
3132  goto __pyx_L0;
3133  __pyx_L1_error:;
3134  __Pyx_XDECREF(__pyx_t_1);
3135  __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3136  __pyx_r = -1;
3137  __pyx_L0:;
3138  __Pyx_RefNannyFinishContext();
3139  return __pyx_r;
3140 }
3141 
3142 /* "csmoothers.pyx":32
3143  * assert rval == 0
3144  *
3145  * def __dealloc__(self): # <<<<<<<<<<<<<<
3146  * casm_NR_free(self.N,
3147  * self.subdomain_dim,
3148  */
3149 
3150 /* Python wrapper */
3151 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3152 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3153  __Pyx_RefNannyDeclarations
3154  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3155  __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3156 
3157  /* function exit code */
3158  __Pyx_RefNannyFinishContext();
3159 }
3160 
3161 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3162  __Pyx_RefNannyDeclarations
3163  __Pyx_RefNannySetupContext("__dealloc__", 0);
3164 
3165  /* "csmoothers.pyx":33
3166  *
3167  * def __dealloc__(self):
3168  * casm_NR_free(self.N, # <<<<<<<<<<<<<<
3169  * self.subdomain_dim,
3170  * self.l2g_L,
3171  */
3172  asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
3173 
3174  /* "csmoothers.pyx":32
3175  * assert rval == 0
3176  *
3177  * def __dealloc__(self): # <<<<<<<<<<<<<<
3178  * casm_NR_free(self.N,
3179  * self.subdomain_dim,
3180  */
3181 
3182  /* function exit code */
3183  __Pyx_RefNannyFinishContext();
3184 }
3185 
3186 /* "(tree fragment)":1
3187  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3188  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3189  * def __setstate_cython__(self, __pyx_state):
3190  */
3191 
3192 /* Python wrapper */
3193 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3194 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3195  PyObject *__pyx_r = 0;
3196  __Pyx_RefNannyDeclarations
3197  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3198  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3199 
3200  /* function exit code */
3201  __Pyx_RefNannyFinishContext();
3202  return __pyx_r;
3203 }
3204 
3205 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3206  PyObject *__pyx_r = NULL;
3207  __Pyx_RefNannyDeclarations
3208  PyObject *__pyx_t_1 = NULL;
3209  int __pyx_lineno = 0;
3210  const char *__pyx_filename = NULL;
3211  int __pyx_clineno = 0;
3212  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3213 
3214  /* "(tree fragment)":2
3215  * def __reduce_cython__(self):
3216  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3217  * def __setstate_cython__(self, __pyx_state):
3218  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3219  */
3220  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3221  __Pyx_GOTREF(__pyx_t_1);
3222  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3223  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3224  __PYX_ERR(1, 2, __pyx_L1_error)
3225 
3226  /* "(tree fragment)":1
3227  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3228  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3229  * def __setstate_cython__(self, __pyx_state):
3230  */
3231 
3232  /* function exit code */
3233  __pyx_L1_error:;
3234  __Pyx_XDECREF(__pyx_t_1);
3235  __Pyx_AddTraceback("csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3236  __pyx_r = NULL;
3237  __Pyx_XGIVEREF(__pyx_r);
3238  __Pyx_RefNannyFinishContext();
3239  return __pyx_r;
3240 }
3241 
3242 /* "(tree fragment)":3
3243  * def __reduce_cython__(self):
3244  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3245  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3246  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3247  */
3248 
3249 /* Python wrapper */
3250 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3251 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3252  PyObject *__pyx_r = 0;
3253  __Pyx_RefNannyDeclarations
3254  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3255  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3256 
3257  /* function exit code */
3258  __Pyx_RefNannyFinishContext();
3259  return __pyx_r;
3260 }
3261 
3262 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3263  PyObject *__pyx_r = NULL;
3264  __Pyx_RefNannyDeclarations
3265  PyObject *__pyx_t_1 = NULL;
3266  int __pyx_lineno = 0;
3267  const char *__pyx_filename = NULL;
3268  int __pyx_clineno = 0;
3269  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3270 
3271  /* "(tree fragment)":4
3272  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3273  * def __setstate_cython__(self, __pyx_state):
3274  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3275  */
3276  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3277  __Pyx_GOTREF(__pyx_t_1);
3278  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3279  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3280  __PYX_ERR(1, 4, __pyx_L1_error)
3281 
3282  /* "(tree fragment)":3
3283  * def __reduce_cython__(self):
3284  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3285  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3286  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3287  */
3288 
3289  /* function exit code */
3290  __pyx_L1_error:;
3291  __Pyx_XDECREF(__pyx_t_1);
3292  __Pyx_AddTraceback("csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3293  __pyx_r = NULL;
3294  __Pyx_XGIVEREF(__pyx_r);
3295  __Pyx_RefNannyFinishContext();
3296  return __pyx_r;
3297 }
3298 
3299 /* "csmoothers.pyx":44
3300  * class BASMFactor(object):
3301  *
3302  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
3303  * self.L = L
3304  * self.bs = bs
3305  */
3306 
3307 /* Python wrapper */
3308 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3309 static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_10BASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
3310 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3311  PyObject *__pyx_v_self = 0;
3312  PyObject *__pyx_v_L = 0;
3313  PyObject *__pyx_v_bs = 0;
3314  int __pyx_lineno = 0;
3315  const char *__pyx_filename = NULL;
3316  int __pyx_clineno = 0;
3317  PyObject *__pyx_r = 0;
3318  __Pyx_RefNannyDeclarations
3319  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3320  {
3321  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,&__pyx_n_s_bs,0};
3322  PyObject* values[3] = {0,0,0};
3323  if (unlikely(__pyx_kwds)) {
3324  Py_ssize_t kw_args;
3325  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3326  switch (pos_args) {
3327  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3328  CYTHON_FALLTHROUGH;
3329  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3330  CYTHON_FALLTHROUGH;
3331  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3332  CYTHON_FALLTHROUGH;
3333  case 0: break;
3334  default: goto __pyx_L5_argtuple_error;
3335  }
3336  kw_args = PyDict_Size(__pyx_kwds);
3337  switch (pos_args) {
3338  case 0:
3339  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3340  else goto __pyx_L5_argtuple_error;
3341  CYTHON_FALLTHROUGH;
3342  case 1:
3343  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3344  else {
3345  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 44, __pyx_L3_error)
3346  }
3347  CYTHON_FALLTHROUGH;
3348  case 2:
3349  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3350  else {
3351  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 44, __pyx_L3_error)
3352  }
3353  }
3354  if (unlikely(kw_args > 0)) {
3355  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
3356  }
3357  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3358  goto __pyx_L5_argtuple_error;
3359  } else {
3360  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3361  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3362  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3363  }
3364  __pyx_v_self = values[0];
3365  __pyx_v_L = values[1];
3366  __pyx_v_bs = values[2];
3367  }
3368  goto __pyx_L4_argument_unpacking_done;
3369  __pyx_L5_argtuple_error:;
3370  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error)
3371  __pyx_L3_error:;
3372  __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3373  __Pyx_RefNannyFinishContext();
3374  return NULL;
3375  __pyx_L4_argument_unpacking_done:;
3376  __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
3377 
3378  /* function exit code */
3379  __Pyx_RefNannyFinishContext();
3380  return __pyx_r;
3381 }
3382 
3383 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
3384  PyObject *__pyx_r = NULL;
3385  __Pyx_RefNannyDeclarations
3386  PyObject *__pyx_t_1 = NULL;
3387  PyObject *__pyx_t_2 = NULL;
3388  PyObject *__pyx_t_3 = NULL;
3389  int __pyx_lineno = 0;
3390  const char *__pyx_filename = NULL;
3391  int __pyx_clineno = 0;
3392  __Pyx_RefNannySetupContext("__init__", 0);
3393 
3394  /* "csmoothers.pyx":45
3395  *
3396  * def __init__(self, L, bs):
3397  * self.L = L # <<<<<<<<<<<<<<
3398  * self.bs = bs
3399  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3400  */
3401  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
3402 
3403  /* "csmoothers.pyx":46
3404  * def __init__(self, L, bs):
3405  * self.L = L
3406  * self.bs = bs # <<<<<<<<<<<<<<
3407  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3408  * self.bs)
3409  */
3410  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bs, __pyx_v_bs) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
3411 
3412  /* "csmoothers.pyx":47
3413  * self.L = L
3414  * self.bs = bs
3415  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
3416  * self.bs)
3417  *
3418  */
3419  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3420  __Pyx_GOTREF(__pyx_t_1);
3421  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
3422  __Pyx_GOTREF(__pyx_t_2);
3423  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3424 
3425  /* "csmoothers.pyx":48
3426  * self.bs = bs
3427  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3428  * self.bs) # <<<<<<<<<<<<<<
3429  *
3430  * cdef class cBASMFactor(object):
3431  */
3432  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
3433  __Pyx_GOTREF(__pyx_t_1);
3434 
3435  /* "csmoothers.pyx":47
3436  * self.L = L
3437  * self.bs = bs
3438  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
3439  * self.bs)
3440  *
3441  */
3442  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
3443  __Pyx_GOTREF(__pyx_t_3);
3444  __Pyx_GIVEREF(__pyx_t_2);
3445  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3446  __Pyx_GIVEREF(__pyx_t_1);
3447  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
3448  __pyx_t_2 = 0;
3449  __pyx_t_1 = 0;
3450  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10csmoothers_cBASMFactor), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3451  __Pyx_GOTREF(__pyx_t_1);
3452  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3453  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cBASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
3454  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3455 
3456  /* "csmoothers.pyx":44
3457  * class BASMFactor(object):
3458  *
3459  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
3460  * self.L = L
3461  * self.bs = bs
3462  */
3463 
3464  /* function exit code */
3465  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3466  goto __pyx_L0;
3467  __pyx_L1_error:;
3468  __Pyx_XDECREF(__pyx_t_1);
3469  __Pyx_XDECREF(__pyx_t_2);
3470  __Pyx_XDECREF(__pyx_t_3);
3471  __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3472  __pyx_r = NULL;
3473  __pyx_L0:;
3474  __Pyx_XGIVEREF(__pyx_r);
3475  __Pyx_RefNannyFinishContext();
3476  return __pyx_r;
3477 }
3478 
3479 /* "csmoothers.pyx":52
3480  * cdef class cBASMFactor(object):
3481  *
3482  * def __cinit__(self, # <<<<<<<<<<<<<<
3483  * superluWrappers.cSparseMatrix L,
3484  * int bs):
3485  */
3486 
3487 /* Python wrapper */
3488 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3489 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3490  struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3491  int __pyx_v_bs;
3492  int __pyx_lineno = 0;
3493  const char *__pyx_filename = NULL;
3494  int __pyx_clineno = 0;
3495  int __pyx_r;
3496  __Pyx_RefNannyDeclarations
3497  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3498  {
3499  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_bs,0};
3500  PyObject* values[2] = {0,0};
3501  if (unlikely(__pyx_kwds)) {
3502  Py_ssize_t kw_args;
3503  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3504  switch (pos_args) {
3505  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3506  CYTHON_FALLTHROUGH;
3507  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3508  CYTHON_FALLTHROUGH;
3509  case 0: break;
3510  default: goto __pyx_L5_argtuple_error;
3511  }
3512  kw_args = PyDict_Size(__pyx_kwds);
3513  switch (pos_args) {
3514  case 0:
3515  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3516  else goto __pyx_L5_argtuple_error;
3517  CYTHON_FALLTHROUGH;
3518  case 1:
3519  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3520  else {
3521  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 52, __pyx_L3_error)
3522  }
3523  }
3524  if (unlikely(kw_args > 0)) {
3525  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3526  }
3527  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3528  goto __pyx_L5_argtuple_error;
3529  } else {
3530  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3531  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3532  }
3533  __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3534  __pyx_v_bs = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_bs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
3535  }
3536  goto __pyx_L4_argument_unpacking_done;
3537  __pyx_L5_argtuple_error:;
3538  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3539  __pyx_L3_error:;
3540  __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3541  __Pyx_RefNannyFinishContext();
3542  return -1;
3543  __pyx_L4_argument_unpacking_done:;
3544  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
3545  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
3546 
3547  /* function exit code */
3548  goto __pyx_L0;
3549  __pyx_L1_error:;
3550  __pyx_r = -1;
3551  __pyx_L0:;
3552  __Pyx_RefNannyFinishContext();
3553  return __pyx_r;
3554 }
3555 
3556 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs) {
3557  int __pyx_v_rval;
3558  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3559  int __pyx_r;
3560  __Pyx_RefNannyDeclarations
3561  PyObject *__pyx_t_1 = NULL;
3562  int __pyx_t_2;
3563  int __pyx_lineno = 0;
3564  const char *__pyx_filename = NULL;
3565  int __pyx_clineno = 0;
3566  __Pyx_RefNannySetupContext("__cinit__", 0);
3567 
3568  /* "csmoothers.pyx":55
3569  * superluWrappers.cSparseMatrix L,
3570  * int bs):
3571  * cdef int rval = 0 # <<<<<<<<<<<<<<
3572  * cdef SuperMatrix AS
3573  * AS.Stype = superluWrappers._SLU_NR
3574  */
3575  __pyx_v_rval = 0;
3576 
3577  /* "csmoothers.pyx":57
3578  * cdef int rval = 0
3579  * cdef SuperMatrix AS
3580  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3581  * AS.Dtype = superluWrappers._SLU_D
3582  * AS.Mtype = superluWrappers._SLU_GE
3583  */
3584  __pyx_v_AS.Stype = SLU_NR;
3585 
3586  /* "csmoothers.pyx":58
3587  * cdef SuperMatrix AS
3588  * AS.Stype = superluWrappers._SLU_NR
3589  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3590  * AS.Mtype = superluWrappers._SLU_GE
3591  * AS.nrow = L.nr
3592  */
3593  __pyx_v_AS.Dtype = SLU_D;
3594 
3595  /* "csmoothers.pyx":59
3596  * AS.Stype = superluWrappers._SLU_NR
3597  * AS.Dtype = superluWrappers._SLU_D
3598  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3599  * AS.nrow = L.nr
3600  * AS.ncol = L.nc
3601  */
3602  __pyx_v_AS.Mtype = SLU_GE;
3603 
3604  /* "csmoothers.pyx":60
3605  * AS.Dtype = superluWrappers._SLU_D
3606  * AS.Mtype = superluWrappers._SLU_GE
3607  * AS.nrow = L.nr # <<<<<<<<<<<<<<
3608  * AS.ncol = L.nc
3609  * AS.Store = &L.A
3610  */
3611  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3612  __Pyx_GOTREF(__pyx_t_1);
3613  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
3614  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3615  __pyx_v_AS.nrow = __pyx_t_2;
3616 
3617  /* "csmoothers.pyx":61
3618  * AS.Mtype = superluWrappers._SLU_GE
3619  * AS.nrow = L.nr
3620  * AS.ncol = L.nc # <<<<<<<<<<<<<<
3621  * AS.Store = &L.A
3622  * rval = cbasm_NR_init(bs,
3623  */
3624  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
3625  __Pyx_GOTREF(__pyx_t_1);
3626  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
3627  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3628  __pyx_v_AS.ncol = __pyx_t_2;
3629 
3630  /* "csmoothers.pyx":62
3631  * AS.nrow = L.nr
3632  * AS.ncol = L.nc
3633  * AS.Store = &L.A # <<<<<<<<<<<<<<
3634  * rval = cbasm_NR_init(bs,
3635  * &AS,
3636  */
3637  __pyx_v_AS.Store = (&__pyx_v_L->A);
3638 
3639  /* "csmoothers.pyx":63
3640  * AS.ncol = L.nc
3641  * AS.Store = &L.A
3642  * rval = cbasm_NR_init(bs, # <<<<<<<<<<<<<<
3643  * &AS,
3644  * &self.subdomain_dim,
3645  */
3646  __pyx_v_rval = basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
3647 
3648  /* "csmoothers.pyx":72
3649  * &self.subdomain_pivots,
3650  * &self.subdomain_col_pivots)
3651  * assert rval == 0 # <<<<<<<<<<<<<<
3652  *
3653  * def __dealloc__(self):
3654  */
3655  #ifndef CYTHON_WITHOUT_ASSERTIONS
3656  if (unlikely(!Py_OptimizeFlag)) {
3657  if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3658  PyErr_SetNone(PyExc_AssertionError);
3659  __PYX_ERR(0, 72, __pyx_L1_error)
3660  }
3661  }
3662  #endif
3663 
3664  /* "csmoothers.pyx":52
3665  * cdef class cBASMFactor(object):
3666  *
3667  * def __cinit__(self, # <<<<<<<<<<<<<<
3668  * superluWrappers.cSparseMatrix L,
3669  * int bs):
3670  */
3671 
3672  /* function exit code */
3673  __pyx_r = 0;
3674  goto __pyx_L0;
3675  __pyx_L1_error:;
3676  __Pyx_XDECREF(__pyx_t_1);
3677  __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3678  __pyx_r = -1;
3679  __pyx_L0:;
3680  __Pyx_RefNannyFinishContext();
3681  return __pyx_r;
3682 }
3683 
3684 /* "csmoothers.pyx":74
3685  * assert rval == 0
3686  *
3687  * def __dealloc__(self): # <<<<<<<<<<<<<<
3688  * cbasm_NR_free(self.N,
3689  * self.subdomain_dim,
3690  */
3691 
3692 /* Python wrapper */
3693 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3694 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3695  __Pyx_RefNannyDeclarations
3696  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3697  __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3698 
3699  /* function exit code */
3700  __Pyx_RefNannyFinishContext();
3701 }
3702 
3703 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3704  __Pyx_RefNannyDeclarations
3705  __Pyx_RefNannySetupContext("__dealloc__", 0);
3706 
3707  /* "csmoothers.pyx":75
3708  *
3709  * def __dealloc__(self):
3710  * cbasm_NR_free(self.N, # <<<<<<<<<<<<<<
3711  * self.subdomain_dim,
3712  * self.l2g_L,
3713  */
3714  basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
3715 
3716  /* "csmoothers.pyx":74
3717  * assert rval == 0
3718  *
3719  * def __dealloc__(self): # <<<<<<<<<<<<<<
3720  * cbasm_NR_free(self.N,
3721  * self.subdomain_dim,
3722  */
3723 
3724  /* function exit code */
3725  __Pyx_RefNannyFinishContext();
3726 }
3727 
3728 /* "(tree fragment)":1
3729  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3730  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3731  * def __setstate_cython__(self, __pyx_state):
3732  */
3733 
3734 /* Python wrapper */
3735 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3736 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3737  PyObject *__pyx_r = 0;
3738  __Pyx_RefNannyDeclarations
3739  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3740  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3741 
3742  /* function exit code */
3743  __Pyx_RefNannyFinishContext();
3744  return __pyx_r;
3745 }
3746 
3747 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3748  PyObject *__pyx_r = NULL;
3749  __Pyx_RefNannyDeclarations
3750  PyObject *__pyx_t_1 = NULL;
3751  int __pyx_lineno = 0;
3752  const char *__pyx_filename = NULL;
3753  int __pyx_clineno = 0;
3754  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3755 
3756  /* "(tree fragment)":2
3757  * def __reduce_cython__(self):
3758  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3759  * def __setstate_cython__(self, __pyx_state):
3760  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3761  */
3762  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3763  __Pyx_GOTREF(__pyx_t_1);
3764  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3765  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3766  __PYX_ERR(1, 2, __pyx_L1_error)
3767 
3768  /* "(tree fragment)":1
3769  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3770  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3771  * def __setstate_cython__(self, __pyx_state):
3772  */
3773 
3774  /* function exit code */
3775  __pyx_L1_error:;
3776  __Pyx_XDECREF(__pyx_t_1);
3777  __Pyx_AddTraceback("csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3778  __pyx_r = NULL;
3779  __Pyx_XGIVEREF(__pyx_r);
3780  __Pyx_RefNannyFinishContext();
3781  return __pyx_r;
3782 }
3783 
3784 /* "(tree fragment)":3
3785  * def __reduce_cython__(self):
3786  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3787  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3788  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3789  */
3790 
3791 /* Python wrapper */
3792 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3793 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3794  PyObject *__pyx_r = 0;
3795  __Pyx_RefNannyDeclarations
3796  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3797  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3798 
3799  /* function exit code */
3800  __Pyx_RefNannyFinishContext();
3801  return __pyx_r;
3802 }
3803 
3804 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3805  PyObject *__pyx_r = NULL;
3806  __Pyx_RefNannyDeclarations
3807  PyObject *__pyx_t_1 = NULL;
3808  int __pyx_lineno = 0;
3809  const char *__pyx_filename = NULL;
3810  int __pyx_clineno = 0;
3811  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3812 
3813  /* "(tree fragment)":4
3814  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3815  * def __setstate_cython__(self, __pyx_state):
3816  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3817  */
3818  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3819  __Pyx_GOTREF(__pyx_t_1);
3820  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3821  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3822  __PYX_ERR(1, 4, __pyx_L1_error)
3823 
3824  /* "(tree fragment)":3
3825  * def __reduce_cython__(self):
3826  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3827  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3828  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3829  */
3830 
3831  /* function exit code */
3832  __pyx_L1_error:;
3833  __Pyx_XDECREF(__pyx_t_1);
3834  __Pyx_AddTraceback("csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3835  __pyx_r = NULL;
3836  __Pyx_XGIVEREF(__pyx_r);
3837  __Pyx_RefNannyFinishContext();
3838  return __pyx_r;
3839 }
3840 
3841 /* "csmoothers.pyx":84
3842  * self.subdomain_col_pivots)
3843  *
3844  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
3845  * """
3846  *
3847  */
3848 
3849 /* Python wrapper */
3850 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3851 static char __pyx_doc_10csmoothers_jacobi_NR_prepare[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ";
3852 static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {"jacobi_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_1jacobi_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
3853 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3854  PyObject *__pyx_v_A = 0;
3855  PyObject *__pyx_v_w = 0;
3856  PyObject *__pyx_v_tol = 0;
3857  PyObject *__pyx_v_M = 0;
3858  int __pyx_lineno = 0;
3859  const char *__pyx_filename = NULL;
3860  int __pyx_clineno = 0;
3861  PyObject *__pyx_r = 0;
3862  __Pyx_RefNannyDeclarations
3863  __Pyx_RefNannySetupContext("jacobi_NR_prepare (wrapper)", 0);
3864  {
3865  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
3866  PyObject* values[4] = {0,0,0,0};
3867  if (unlikely(__pyx_kwds)) {
3868  Py_ssize_t kw_args;
3869  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3870  switch (pos_args) {
3871  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3872  CYTHON_FALLTHROUGH;
3873  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3874  CYTHON_FALLTHROUGH;
3875  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3876  CYTHON_FALLTHROUGH;
3877  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3878  CYTHON_FALLTHROUGH;
3879  case 0: break;
3880  default: goto __pyx_L5_argtuple_error;
3881  }
3882  kw_args = PyDict_Size(__pyx_kwds);
3883  switch (pos_args) {
3884  case 0:
3885  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3886  else goto __pyx_L5_argtuple_error;
3887  CYTHON_FALLTHROUGH;
3888  case 1:
3889  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
3890  else {
3891  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 1); __PYX_ERR(0, 84, __pyx_L3_error)
3892  }
3893  CYTHON_FALLTHROUGH;
3894  case 2:
3895  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
3896  else {
3897  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 2); __PYX_ERR(0, 84, __pyx_L3_error)
3898  }
3899  CYTHON_FALLTHROUGH;
3900  case 3:
3901  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
3902  else {
3903  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 3); __PYX_ERR(0, 84, __pyx_L3_error)
3904  }
3905  }
3906  if (unlikely(kw_args > 0)) {
3907  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "jacobi_NR_prepare") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
3908  }
3909  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3910  goto __pyx_L5_argtuple_error;
3911  } else {
3912  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3913  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3914  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3915  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3916  }
3917  __pyx_v_A = values[0];
3918  __pyx_v_w = values[1];
3919  __pyx_v_tol = values[2];
3920  __pyx_v_M = values[3];
3921  }
3922  goto __pyx_L4_argument_unpacking_done;
3923  __pyx_L5_argtuple_error:;
3924  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
3925  __pyx_L3_error:;
3926  __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3927  __Pyx_RefNannyFinishContext();
3928  return NULL;
3929  __pyx_L4_argument_unpacking_done:;
3930  __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
3931 
3932  /* function exit code */
3933  __Pyx_RefNannyFinishContext();
3934  return __pyx_r;
3935 }
3936 
3937 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
3938  PyObject *__pyx_r = NULL;
3939  __Pyx_RefNannyDeclarations
3940  PyObject *__pyx_t_1 = NULL;
3941  double __pyx_t_2;
3942  double __pyx_t_3;
3943  __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
3944  int __pyx_lineno = 0;
3945  const char *__pyx_filename = NULL;
3946  int __pyx_clineno = 0;
3947  __Pyx_RefNannySetupContext("jacobi_NR_prepare", 0);
3948 
3949  /* "csmoothers.pyx":94
3950  * M : np.array
3951  * """
3952  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
3953  *
3954  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm,
3955  */
3956  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
3957  __Pyx_GOTREF(__pyx_t_1);
3958  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 94, __pyx_L1_error)
3959  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3960  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3961  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
3962  __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
3963  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3964  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3965  __pyx_t_4.memview = NULL;
3966  __pyx_t_4.data = NULL;
3967 
3968  /* "csmoothers.pyx":84
3969  * self.subdomain_col_pivots)
3970  *
3971  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
3972  * """
3973  *
3974  */
3975 
3976  /* function exit code */
3977  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3978  goto __pyx_L0;
3979  __pyx_L1_error:;
3980  __Pyx_XDECREF(__pyx_t_1);
3981  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3982  __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3983  __pyx_r = NULL;
3984  __pyx_L0:;
3985  __Pyx_XGIVEREF(__pyx_r);
3986  __Pyx_RefNannyFinishContext();
3987  return __pyx_r;
3988 }
3989 
3990 /* "csmoothers.pyx":96
3991  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
3992  *
3993  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
3994  * double w,
3995  * double tol,
3996  */
3997 
3998 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
3999  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4000  __Pyx_RefNannyDeclarations
4001  PyObject *__pyx_t_1 = NULL;
4002  int __pyx_t_2;
4003  Py_ssize_t __pyx_t_3;
4004  int __pyx_lineno = 0;
4005  const char *__pyx_filename = NULL;
4006  int __pyx_clineno = 0;
4007  __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_prepare", 0);
4008 
4009  /* "csmoothers.pyx":101
4010  * DDATA M):
4011  * cdef SuperMatrix AS
4012  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4013  * AS.Dtype = superluWrappers._SLU_D
4014  * AS.Mtype = superluWrappers._SLU_GE
4015  */
4016  __pyx_v_AS.Stype = SLU_NR;
4017 
4018  /* "csmoothers.pyx":102
4019  * cdef SuperMatrix AS
4020  * AS.Stype = superluWrappers._SLU_NR
4021  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4022  * AS.Mtype = superluWrappers._SLU_GE
4023  * AS.nrow = sm.nr
4024  */
4025  __pyx_v_AS.Dtype = SLU_D;
4026 
4027  /* "csmoothers.pyx":103
4028  * AS.Stype = superluWrappers._SLU_NR
4029  * AS.Dtype = superluWrappers._SLU_D
4030  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4031  * AS.nrow = sm.nr
4032  * AS.ncol = sm.nc
4033  */
4034  __pyx_v_AS.Mtype = SLU_GE;
4035 
4036  /* "csmoothers.pyx":104
4037  * AS.Dtype = superluWrappers._SLU_D
4038  * AS.Mtype = superluWrappers._SLU_GE
4039  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4040  * AS.ncol = sm.nc
4041  * AS.Store = &sm.A
4042  */
4043  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
4044  __Pyx_GOTREF(__pyx_t_1);
4045  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4046  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4047  __pyx_v_AS.nrow = __pyx_t_2;
4048 
4049  /* "csmoothers.pyx":105
4050  * AS.Mtype = superluWrappers._SLU_GE
4051  * AS.nrow = sm.nr
4052  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4053  * AS.Store = &sm.A
4054  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4055  */
4056  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
4057  __Pyx_GOTREF(__pyx_t_1);
4058  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
4059  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4060  __pyx_v_AS.ncol = __pyx_t_2;
4061 
4062  /* "csmoothers.pyx":106
4063  * AS.nrow = sm.nr
4064  * AS.ncol = sm.nc
4065  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4066  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4067  *
4068  */
4069  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4070 
4071  /* "csmoothers.pyx":107
4072  * AS.ncol = sm.nc
4073  * AS.Store = &sm.A
4074  * cjacobi_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
4075  *
4076  * def jacobi_NR_solve(A, M, R, node_order, dX):
4077  */
4078  __pyx_t_3 = 0;
4079  __pyx_t_2 = -1;
4080  if (__pyx_t_3 < 0) {
4081  __pyx_t_3 += __pyx_v_M.shape[0];
4082  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4083  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4084  if (unlikely(__pyx_t_2 != -1)) {
4085  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4086  __PYX_ERR(0, 107, __pyx_L1_error)
4087  }
4088  jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4089 
4090  /* "csmoothers.pyx":96
4091  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
4092  *
4093  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4094  * double w,
4095  * double tol,
4096  */
4097 
4098  /* function exit code */
4099  goto __pyx_L0;
4100  __pyx_L1_error:;
4101  __Pyx_XDECREF(__pyx_t_1);
4102  __Pyx_WriteUnraisable("csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4103  __pyx_L0:;
4104  __Pyx_RefNannyFinishContext();
4105 }
4106 
4107 /* "csmoothers.pyx":109
4108  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4109  *
4110  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4111  * """
4112  *
4113  */
4114 
4115 /* Python wrapper */
4116 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4117 static char __pyx_doc_10csmoothers_2jacobi_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4118 static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {"jacobi_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_3jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
4119 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4120  PyObject *__pyx_v_A = 0;
4121  PyObject *__pyx_v_M = 0;
4122  PyObject *__pyx_v_R = 0;
4123  PyObject *__pyx_v_node_order = 0;
4124  PyObject *__pyx_v_dX = 0;
4125  int __pyx_lineno = 0;
4126  const char *__pyx_filename = NULL;
4127  int __pyx_clineno = 0;
4128  PyObject *__pyx_r = 0;
4129  __Pyx_RefNannyDeclarations
4130  __Pyx_RefNannySetupContext("jacobi_NR_solve (wrapper)", 0);
4131  {
4132  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4133  PyObject* values[5] = {0,0,0,0,0};
4134  if (unlikely(__pyx_kwds)) {
4135  Py_ssize_t kw_args;
4136  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4137  switch (pos_args) {
4138  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4139  CYTHON_FALLTHROUGH;
4140  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4141  CYTHON_FALLTHROUGH;
4142  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4143  CYTHON_FALLTHROUGH;
4144  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4145  CYTHON_FALLTHROUGH;
4146  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4147  CYTHON_FALLTHROUGH;
4148  case 0: break;
4149  default: goto __pyx_L5_argtuple_error;
4150  }
4151  kw_args = PyDict_Size(__pyx_kwds);
4152  switch (pos_args) {
4153  case 0:
4154  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4155  else goto __pyx_L5_argtuple_error;
4156  CYTHON_FALLTHROUGH;
4157  case 1:
4158  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4159  else {
4160  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 109, __pyx_L3_error)
4161  }
4162  CYTHON_FALLTHROUGH;
4163  case 2:
4164  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4165  else {
4166  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 109, __pyx_L3_error)
4167  }
4168  CYTHON_FALLTHROUGH;
4169  case 3:
4170  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4171  else {
4172  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 109, __pyx_L3_error)
4173  }
4174  CYTHON_FALLTHROUGH;
4175  case 4:
4176  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4177  else {
4178  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 109, __pyx_L3_error)
4179  }
4180  }
4181  if (unlikely(kw_args > 0)) {
4182  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "jacobi_NR_solve") < 0)) __PYX_ERR(0, 109, __pyx_L3_error)
4183  }
4184  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4185  goto __pyx_L5_argtuple_error;
4186  } else {
4187  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4188  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4189  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4190  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4191  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4192  }
4193  __pyx_v_A = values[0];
4194  __pyx_v_M = values[1];
4195  __pyx_v_R = values[2];
4196  __pyx_v_node_order = values[3];
4197  __pyx_v_dX = values[4];
4198  }
4199  goto __pyx_L4_argument_unpacking_done;
4200  __pyx_L5_argtuple_error:;
4201  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 109, __pyx_L3_error)
4202  __pyx_L3_error:;
4203  __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4204  __Pyx_RefNannyFinishContext();
4205  return NULL;
4206  __pyx_L4_argument_unpacking_done:;
4207  __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4208 
4209  /* function exit code */
4210  __Pyx_RefNannyFinishContext();
4211  return __pyx_r;
4212 }
4213 
4214 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4215  PyObject *__pyx_r = NULL;
4216  __Pyx_RefNannyDeclarations
4217  PyObject *__pyx_t_1 = NULL;
4218  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4219  __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4220  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4221  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4222  int __pyx_lineno = 0;
4223  const char *__pyx_filename = NULL;
4224  int __pyx_clineno = 0;
4225  __Pyx_RefNannySetupContext("jacobi_NR_solve", 0);
4226 
4227  /* "csmoothers.pyx":120
4228  * dX : np.array double
4229  * """
4230  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
4231  *
4232  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm,
4233  */
4234  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4235  __Pyx_GOTREF(__pyx_t_1);
4236  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 120, __pyx_L1_error)
4237  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4238  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4239  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4240  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4241  __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4242  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4243  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4244  __pyx_t_2.memview = NULL;
4245  __pyx_t_2.data = NULL;
4246  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4247  __pyx_t_3.memview = NULL;
4248  __pyx_t_3.data = NULL;
4249  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4250  __pyx_t_4.memview = NULL;
4251  __pyx_t_4.data = NULL;
4252  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4253  __pyx_t_5.memview = NULL;
4254  __pyx_t_5.data = NULL;
4255 
4256  /* "csmoothers.pyx":109
4257  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4258  *
4259  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4260  * """
4261  *
4262  */
4263 
4264  /* function exit code */
4265  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4266  goto __pyx_L0;
4267  __pyx_L1_error:;
4268  __Pyx_XDECREF(__pyx_t_1);
4269  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4270  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4271  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4272  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4273  __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4274  __pyx_r = NULL;
4275  __pyx_L0:;
4276  __Pyx_XGIVEREF(__pyx_r);
4277  __Pyx_RefNannyFinishContext();
4278  return __pyx_r;
4279 }
4280 
4281 /* "csmoothers.pyx":122
4282  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
4283  *
4284  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4285  * DDATA M,
4286  * DDATA R,
4287  */
4288 
4289 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4290  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4291  __Pyx_RefNannyDeclarations
4292  PyObject *__pyx_t_1 = NULL;
4293  int __pyx_t_2;
4294  Py_ssize_t __pyx_t_3;
4295  Py_ssize_t __pyx_t_4;
4296  Py_ssize_t __pyx_t_5;
4297  Py_ssize_t __pyx_t_6;
4298  int __pyx_lineno = 0;
4299  const char *__pyx_filename = NULL;
4300  int __pyx_clineno = 0;
4301  __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_solve", 0);
4302 
4303  /* "csmoothers.pyx":128
4304  * DDATA dX):
4305  * cdef SuperMatrix AS
4306  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4307  * AS.Dtype = superluWrappers._SLU_D
4308  * AS.Mtype = superluWrappers._SLU_GE
4309  */
4310  __pyx_v_AS.Stype = SLU_NR;
4311 
4312  /* "csmoothers.pyx":129
4313  * cdef SuperMatrix AS
4314  * AS.Stype = superluWrappers._SLU_NR
4315  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4316  * AS.Mtype = superluWrappers._SLU_GE
4317  * AS.nrow = sm.nr
4318  */
4319  __pyx_v_AS.Dtype = SLU_D;
4320 
4321  /* "csmoothers.pyx":130
4322  * AS.Stype = superluWrappers._SLU_NR
4323  * AS.Dtype = superluWrappers._SLU_D
4324  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4325  * AS.nrow = sm.nr
4326  * AS.ncol = sm.nc
4327  */
4328  __pyx_v_AS.Mtype = SLU_GE;
4329 
4330  /* "csmoothers.pyx":131
4331  * AS.Dtype = superluWrappers._SLU_D
4332  * AS.Mtype = superluWrappers._SLU_GE
4333  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4334  * AS.ncol = sm.nc
4335  * AS.Store = &sm.A
4336  */
4337  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
4338  __Pyx_GOTREF(__pyx_t_1);
4339  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
4340  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4341  __pyx_v_AS.nrow = __pyx_t_2;
4342 
4343  /* "csmoothers.pyx":132
4344  * AS.Mtype = superluWrappers._SLU_GE
4345  * AS.nrow = sm.nr
4346  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4347  * AS.Store = &sm.A
4348  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4349  */
4350  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4351  __Pyx_GOTREF(__pyx_t_1);
4352  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
4353  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4354  __pyx_v_AS.ncol = __pyx_t_2;
4355 
4356  /* "csmoothers.pyx":133
4357  * AS.nrow = sm.nr
4358  * AS.ncol = sm.nc
4359  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4360  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4361  *
4362  */
4363  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4364 
4365  /* "csmoothers.pyx":134
4366  * AS.ncol = sm.nc
4367  * AS.Store = &sm.A
4368  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
4369  *
4370  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX):
4371  */
4372  __pyx_t_3 = 0;
4373  __pyx_t_2 = -1;
4374  if (__pyx_t_3 < 0) {
4375  __pyx_t_3 += __pyx_v_M.shape[0];
4376  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4377  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4378  if (unlikely(__pyx_t_2 != -1)) {
4379  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4380  __PYX_ERR(0, 134, __pyx_L1_error)
4381  }
4382  __pyx_t_4 = 0;
4383  __pyx_t_2 = -1;
4384  if (__pyx_t_4 < 0) {
4385  __pyx_t_4 += __pyx_v_R.shape[0];
4386  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4387  } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4388  if (unlikely(__pyx_t_2 != -1)) {
4389  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4390  __PYX_ERR(0, 134, __pyx_L1_error)
4391  }
4392  __pyx_t_5 = 0;
4393  __pyx_t_2 = -1;
4394  if (__pyx_t_5 < 0) {
4395  __pyx_t_5 += __pyx_v_node_order.shape[0];
4396  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4397  } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4398  if (unlikely(__pyx_t_2 != -1)) {
4399  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4400  __PYX_ERR(0, 134, __pyx_L1_error)
4401  }
4402  __pyx_t_6 = 0;
4403  __pyx_t_2 = -1;
4404  if (__pyx_t_6 < 0) {
4405  __pyx_t_6 += __pyx_v_dX.shape[0];
4406  if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
4407  } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4408  if (unlikely(__pyx_t_2 != -1)) {
4409  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4410  __PYX_ERR(0, 134, __pyx_L1_error)
4411  }
4412  jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
4413 
4414  /* "csmoothers.pyx":122
4415  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
4416  *
4417  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4418  * DDATA M,
4419  * DDATA R,
4420  */
4421 
4422  /* function exit code */
4423  goto __pyx_L0;
4424  __pyx_L1_error:;
4425  __Pyx_XDECREF(__pyx_t_1);
4426  __Pyx_WriteUnraisable("csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4427  __pyx_L0:;
4428  __Pyx_RefNannyFinishContext();
4429 }
4430 
4431 /* "csmoothers.pyx":136
4432  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4433  *
4434  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
4435  * """
4436  *
4437  */
4438 
4439 /* Python wrapper */
4440 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4441 static char __pyx_doc_10csmoothers_4nl_jacobi_NR_solve[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ";
4442 static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {"nl_jacobi_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
4443 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4444  PyObject *__pyx_v_A = 0;
4445  PyObject *__pyx_v_R = 0;
4446  PyObject *__pyx_v_node_order = 0;
4447  PyObject *__pyx_v_w = 0;
4448  PyObject *__pyx_v_tol = 0;
4449  PyObject *__pyx_v_dX = 0;
4450  int __pyx_lineno = 0;
4451  const char *__pyx_filename = NULL;
4452  int __pyx_clineno = 0;
4453  PyObject *__pyx_r = 0;
4454  __Pyx_RefNannyDeclarations
4455  __Pyx_RefNannySetupContext("nl_jacobi_NR_solve (wrapper)", 0);
4456  {
4457  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
4458  PyObject* values[6] = {0,0,0,0,0,0};
4459  if (unlikely(__pyx_kwds)) {
4460  Py_ssize_t kw_args;
4461  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4462  switch (pos_args) {
4463  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4464  CYTHON_FALLTHROUGH;
4465  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4466  CYTHON_FALLTHROUGH;
4467  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4468  CYTHON_FALLTHROUGH;
4469  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4470  CYTHON_FALLTHROUGH;
4471  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4472  CYTHON_FALLTHROUGH;
4473  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4474  CYTHON_FALLTHROUGH;
4475  case 0: break;
4476  default: goto __pyx_L5_argtuple_error;
4477  }
4478  kw_args = PyDict_Size(__pyx_kwds);
4479  switch (pos_args) {
4480  case 0:
4481  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4482  else goto __pyx_L5_argtuple_error;
4483  CYTHON_FALLTHROUGH;
4484  case 1:
4485  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4486  else {
4487  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4488  }
4489  CYTHON_FALLTHROUGH;
4490  case 2:
4491  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4492  else {
4493  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 136, __pyx_L3_error)
4494  }
4495  CYTHON_FALLTHROUGH;
4496  case 3:
4497  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4498  else {
4499  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 136, __pyx_L3_error)
4500  }
4501  CYTHON_FALLTHROUGH;
4502  case 4:
4503  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4504  else {
4505  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 136, __pyx_L3_error)
4506  }
4507  CYTHON_FALLTHROUGH;
4508  case 5:
4509  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4510  else {
4511  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 136, __pyx_L3_error)
4512  }
4513  }
4514  if (unlikely(kw_args > 0)) {
4515  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nl_jacobi_NR_solve") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
4516  }
4517  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4518  goto __pyx_L5_argtuple_error;
4519  } else {
4520  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4521  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4522  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4523  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4524  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4525  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4526  }
4527  __pyx_v_A = values[0];
4528  __pyx_v_R = values[1];
4529  __pyx_v_node_order = values[2];
4530  __pyx_v_w = values[3];
4531  __pyx_v_tol = values[4];
4532  __pyx_v_dX = values[5];
4533  }
4534  goto __pyx_L4_argument_unpacking_done;
4535  __pyx_L5_argtuple_error:;
4536  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
4537  __pyx_L3_error:;
4538  __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4539  __Pyx_RefNannyFinishContext();
4540  return NULL;
4541  __pyx_L4_argument_unpacking_done:;
4542  __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
4543 
4544  /* function exit code */
4545  __Pyx_RefNannyFinishContext();
4546  return __pyx_r;
4547 }
4548 
4549 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
4550  PyObject *__pyx_r = NULL;
4551  __Pyx_RefNannyDeclarations
4552  PyObject *__pyx_t_1 = NULL;
4553  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4554  __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4555  double __pyx_t_4;
4556  double __pyx_t_5;
4557  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4558  int __pyx_lineno = 0;
4559  const char *__pyx_filename = NULL;
4560  int __pyx_clineno = 0;
4561  __Pyx_RefNannySetupContext("nl_jacobi_NR_solve", 0);
4562 
4563  /* "csmoothers.pyx":148
4564  * dX : np.array double
4565  * """
4566  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX) # <<<<<<<<<<<<<<
4567  *
4568  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm,
4569  */
4570  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
4571  __Pyx_GOTREF(__pyx_t_1);
4572  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 148, __pyx_L1_error)
4573  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4574  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4575  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4576  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4577  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4578  __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
4579  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4580  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4581  __pyx_t_2.memview = NULL;
4582  __pyx_t_2.data = NULL;
4583  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4584  __pyx_t_3.memview = NULL;
4585  __pyx_t_3.data = NULL;
4586  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4587  __pyx_t_6.memview = NULL;
4588  __pyx_t_6.data = NULL;
4589 
4590  /* "csmoothers.pyx":136
4591  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4592  *
4593  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
4594  * """
4595  *
4596  */
4597 
4598  /* function exit code */
4599  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4600  goto __pyx_L0;
4601  __pyx_L1_error:;
4602  __Pyx_XDECREF(__pyx_t_1);
4603  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4604  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4605  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4606  __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4607  __pyx_r = NULL;
4608  __pyx_L0:;
4609  __Pyx_XGIVEREF(__pyx_r);
4610  __Pyx_RefNannyFinishContext();
4611  return __pyx_r;
4612 }
4613 
4614 /* "csmoothers.pyx":150
4615  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
4616  *
4617  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4618  * DDATA R,
4619  * IDATA node_order,
4620  */
4621 
4622 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4623  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4624  __Pyx_RefNannyDeclarations
4625  PyObject *__pyx_t_1 = NULL;
4626  int __pyx_t_2;
4627  Py_ssize_t __pyx_t_3;
4628  Py_ssize_t __pyx_t_4;
4629  Py_ssize_t __pyx_t_5;
4630  int __pyx_lineno = 0;
4631  const char *__pyx_filename = NULL;
4632  int __pyx_clineno = 0;
4633  __Pyx_RefNannySetupContext("smootherWrappersnl_jacobi_NR_solve", 0);
4634 
4635  /* "csmoothers.pyx":157
4636  * DDATA dX):
4637  * cdef SuperMatrix AS
4638  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4639  * AS.Dtype = superluWrappers._SLU_D
4640  * AS.Mtype = superluWrappers._SLU_GE
4641  */
4642  __pyx_v_AS.Stype = SLU_NR;
4643 
4644  /* "csmoothers.pyx":158
4645  * cdef SuperMatrix AS
4646  * AS.Stype = superluWrappers._SLU_NR
4647  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4648  * AS.Mtype = superluWrappers._SLU_GE
4649  * AS.nrow = sm.nr
4650  */
4651  __pyx_v_AS.Dtype = SLU_D;
4652 
4653  /* "csmoothers.pyx":159
4654  * AS.Stype = superluWrappers._SLU_NR
4655  * AS.Dtype = superluWrappers._SLU_D
4656  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4657  * AS.nrow = sm.nr
4658  * AS.ncol = sm.nc
4659  */
4660  __pyx_v_AS.Mtype = SLU_GE;
4661 
4662  /* "csmoothers.pyx":160
4663  * AS.Dtype = superluWrappers._SLU_D
4664  * AS.Mtype = superluWrappers._SLU_GE
4665  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4666  * AS.ncol = sm.nc
4667  * AS.Store = &sm.A
4668  */
4669  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
4670  __Pyx_GOTREF(__pyx_t_1);
4671  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4672  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4673  __pyx_v_AS.nrow = __pyx_t_2;
4674 
4675  /* "csmoothers.pyx":161
4676  * AS.Mtype = superluWrappers._SLU_GE
4677  * AS.nrow = sm.nr
4678  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4679  * AS.Store = &sm.A
4680  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4681  */
4682  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
4683  __Pyx_GOTREF(__pyx_t_1);
4684  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
4685  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4686  __pyx_v_AS.ncol = __pyx_t_2;
4687 
4688  /* "csmoothers.pyx":162
4689  * AS.nrow = sm.nr
4690  * AS.ncol = sm.nc
4691  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4692  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4693  *
4694  */
4695  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4696 
4697  /* "csmoothers.pyx":163
4698  * AS.ncol = sm.nc
4699  * AS.Store = &sm.A
4700  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
4701  *
4702  * def gauss_seidel_NR_preare(A, w, tol, M):
4703  */
4704  __pyx_t_3 = 0;
4705  __pyx_t_2 = -1;
4706  if (__pyx_t_3 < 0) {
4707  __pyx_t_3 += __pyx_v_R.shape[0];
4708  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4709  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4710  if (unlikely(__pyx_t_2 != -1)) {
4711  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4712  __PYX_ERR(0, 163, __pyx_L1_error)
4713  }
4714  __pyx_t_4 = 0;
4715  __pyx_t_2 = -1;
4716  if (__pyx_t_4 < 0) {
4717  __pyx_t_4 += __pyx_v_node_order.shape[0];
4718  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4719  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4720  if (unlikely(__pyx_t_2 != -1)) {
4721  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4722  __PYX_ERR(0, 163, __pyx_L1_error)
4723  }
4724  __pyx_t_5 = 0;
4725  __pyx_t_2 = -1;
4726  if (__pyx_t_5 < 0) {
4727  __pyx_t_5 += __pyx_v_dX.shape[0];
4728  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4729  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4730  if (unlikely(__pyx_t_2 != -1)) {
4731  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4732  __PYX_ERR(0, 163, __pyx_L1_error)
4733  }
4734  nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
4735 
4736  /* "csmoothers.pyx":150
4737  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
4738  *
4739  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4740  * DDATA R,
4741  * IDATA node_order,
4742  */
4743 
4744  /* function exit code */
4745  goto __pyx_L0;
4746  __pyx_L1_error:;
4747  __Pyx_XDECREF(__pyx_t_1);
4748  __Pyx_WriteUnraisable("csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4749  __pyx_L0:;
4750  __Pyx_RefNannyFinishContext();
4751 }
4752 
4753 /* "csmoothers.pyx":165
4754  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4755  *
4756  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
4757  * """
4758  *
4759  */
4760 
4761 /* Python wrapper */
4762 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4763 static char __pyx_doc_10csmoothers_6gauss_seidel_NR_preare[] = "\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ";
4764 static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {"gauss_seidel_NR_preare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
4765 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4766  PyObject *__pyx_v_A = 0;
4767  PyObject *__pyx_v_w = 0;
4768  PyObject *__pyx_v_tol = 0;
4769  PyObject *__pyx_v_M = 0;
4770  int __pyx_lineno = 0;
4771  const char *__pyx_filename = NULL;
4772  int __pyx_clineno = 0;
4773  PyObject *__pyx_r = 0;
4774  __Pyx_RefNannyDeclarations
4775  __Pyx_RefNannySetupContext("gauss_seidel_NR_preare (wrapper)", 0);
4776  {
4777  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
4778  PyObject* values[4] = {0,0,0,0};
4779  if (unlikely(__pyx_kwds)) {
4780  Py_ssize_t kw_args;
4781  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4782  switch (pos_args) {
4783  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4784  CYTHON_FALLTHROUGH;
4785  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4786  CYTHON_FALLTHROUGH;
4787  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4788  CYTHON_FALLTHROUGH;
4789  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4790  CYTHON_FALLTHROUGH;
4791  case 0: break;
4792  default: goto __pyx_L5_argtuple_error;
4793  }
4794  kw_args = PyDict_Size(__pyx_kwds);
4795  switch (pos_args) {
4796  case 0:
4797  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4798  else goto __pyx_L5_argtuple_error;
4799  CYTHON_FALLTHROUGH;
4800  case 1:
4801  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4802  else {
4803  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 1); __PYX_ERR(0, 165, __pyx_L3_error)
4804  }
4805  CYTHON_FALLTHROUGH;
4806  case 2:
4807  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4808  else {
4809  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 2); __PYX_ERR(0, 165, __pyx_L3_error)
4810  }
4811  CYTHON_FALLTHROUGH;
4812  case 3:
4813  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4814  else {
4815  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 3); __PYX_ERR(0, 165, __pyx_L3_error)
4816  }
4817  }
4818  if (unlikely(kw_args > 0)) {
4819  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gauss_seidel_NR_preare") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4820  }
4821  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4822  goto __pyx_L5_argtuple_error;
4823  } else {
4824  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4825  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4826  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4827  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4828  }
4829  __pyx_v_A = values[0];
4830  __pyx_v_w = values[1];
4831  __pyx_v_tol = values[2];
4832  __pyx_v_M = values[3];
4833  }
4834  goto __pyx_L4_argument_unpacking_done;
4835  __pyx_L5_argtuple_error:;
4836  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4837  __pyx_L3_error:;
4838  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4839  __Pyx_RefNannyFinishContext();
4840  return NULL;
4841  __pyx_L4_argument_unpacking_done:;
4842  __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4843 
4844  /* function exit code */
4845  __Pyx_RefNannyFinishContext();
4846  return __pyx_r;
4847 }
4848 
4849 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4850  PyObject *__pyx_r = NULL;
4851  __Pyx_RefNannyDeclarations
4852  PyObject *__pyx_t_1 = NULL;
4853  double __pyx_t_2;
4854  double __pyx_t_3;
4855  __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4856  int __pyx_lineno = 0;
4857  const char *__pyx_filename = NULL;
4858  int __pyx_clineno = 0;
4859  __Pyx_RefNannySetupContext("gauss_seidel_NR_preare", 0);
4860 
4861  /* "csmoothers.pyx":175
4862  * M :
4863  * """
4864  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
4865  *
4866  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm,
4867  */
4868  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4869  __Pyx_GOTREF(__pyx_t_1);
4870  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 175, __pyx_L1_error)
4871  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4872  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4873  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 175, __pyx_L1_error)
4874  __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4875  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4876  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4877  __pyx_t_4.memview = NULL;
4878  __pyx_t_4.data = NULL;
4879 
4880  /* "csmoothers.pyx":165
4881  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4882  *
4883  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
4884  * """
4885  *
4886  */
4887 
4888  /* function exit code */
4889  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4890  goto __pyx_L0;
4891  __pyx_L1_error:;
4892  __Pyx_XDECREF(__pyx_t_1);
4893  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4894  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4895  __pyx_r = NULL;
4896  __pyx_L0:;
4897  __Pyx_XGIVEREF(__pyx_r);
4898  __Pyx_RefNannyFinishContext();
4899  return __pyx_r;
4900 }
4901 
4902 /* "csmoothers.pyx":177
4903  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
4904  *
4905  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4906  * double w,
4907  * double tol,
4908  */
4909 
4910 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
4911  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4912  __Pyx_RefNannyDeclarations
4913  PyObject *__pyx_t_1 = NULL;
4914  int __pyx_t_2;
4915  Py_ssize_t __pyx_t_3;
4916  int __pyx_lineno = 0;
4917  const char *__pyx_filename = NULL;
4918  int __pyx_clineno = 0;
4919  __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_prepare", 0);
4920 
4921  /* "csmoothers.pyx":182
4922  * DDATA M):
4923  * cdef SuperMatrix AS
4924  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4925  * AS.Dtype = superluWrappers._SLU_D
4926  * AS.Mtype = superluWrappers._SLU_GE
4927  */
4928  __pyx_v_AS.Stype = SLU_NR;
4929 
4930  /* "csmoothers.pyx":183
4931  * cdef SuperMatrix AS
4932  * AS.Stype = superluWrappers._SLU_NR
4933  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4934  * AS.Mtype = superluWrappers._SLU_GE
4935  * AS.nrow = sm.nr
4936  */
4937  __pyx_v_AS.Dtype = SLU_D;
4938 
4939  /* "csmoothers.pyx":184
4940  * AS.Stype = superluWrappers._SLU_NR
4941  * AS.Dtype = superluWrappers._SLU_D
4942  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4943  * AS.nrow = sm.nr
4944  * AS.ncol = sm.nc
4945  */
4946  __pyx_v_AS.Mtype = SLU_GE;
4947 
4948  /* "csmoothers.pyx":185
4949  * AS.Dtype = superluWrappers._SLU_D
4950  * AS.Mtype = superluWrappers._SLU_GE
4951  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4952  * AS.ncol = sm.nc
4953  * AS.Store = &sm.A
4954  */
4955  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
4956  __Pyx_GOTREF(__pyx_t_1);
4957  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4958  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4959  __pyx_v_AS.nrow = __pyx_t_2;
4960 
4961  /* "csmoothers.pyx":186
4962  * AS.Mtype = superluWrappers._SLU_GE
4963  * AS.nrow = sm.nr
4964  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4965  * AS.Store = &sm.A
4966  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
4967  */
4968  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
4969  __Pyx_GOTREF(__pyx_t_1);
4970  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4971  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4972  __pyx_v_AS.ncol = __pyx_t_2;
4973 
4974  /* "csmoothers.pyx":187
4975  * AS.nrow = sm.nr
4976  * AS.ncol = sm.nc
4977  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4978  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
4979  *
4980  */
4981  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4982 
4983  /* "csmoothers.pyx":188
4984  * AS.ncol = sm.nc
4985  * AS.Store = &sm.A
4986  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
4987  *
4988  * def gauss_seidel_NR_solve(A, M, R, node_order, dX):
4989  */
4990  __pyx_t_3 = 0;
4991  __pyx_t_2 = -1;
4992  if (__pyx_t_3 < 0) {
4993  __pyx_t_3 += __pyx_v_M.shape[0];
4994  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4995  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4996  if (unlikely(__pyx_t_2 != -1)) {
4997  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4998  __PYX_ERR(0, 188, __pyx_L1_error)
4999  }
5000  gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
5001 
5002  /* "csmoothers.pyx":177
5003  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
5004  *
5005  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5006  * double w,
5007  * double tol,
5008  */
5009 
5010  /* function exit code */
5011  goto __pyx_L0;
5012  __pyx_L1_error:;
5013  __Pyx_XDECREF(__pyx_t_1);
5014  __Pyx_WriteUnraisable("csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5015  __pyx_L0:;
5016  __Pyx_RefNannyFinishContext();
5017 }
5018 
5019 /* "csmoothers.pyx":190
5020  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5021  *
5022  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
5023  * """
5024  *
5025  */
5026 
5027 /* Python wrapper */
5028 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5029 static char __pyx_doc_10csmoothers_8gauss_seidel_NR_solve[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
5030 static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {"gauss_seidel_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
5031 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5032  PyObject *__pyx_v_A = 0;
5033  PyObject *__pyx_v_M = 0;
5034  PyObject *__pyx_v_R = 0;
5035  PyObject *__pyx_v_node_order = 0;
5036  PyObject *__pyx_v_dX = 0;
5037  int __pyx_lineno = 0;
5038  const char *__pyx_filename = NULL;
5039  int __pyx_clineno = 0;
5040  PyObject *__pyx_r = 0;
5041  __Pyx_RefNannyDeclarations
5042  __Pyx_RefNannySetupContext("gauss_seidel_NR_solve (wrapper)", 0);
5043  {
5044  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
5045  PyObject* values[5] = {0,0,0,0,0};
5046  if (unlikely(__pyx_kwds)) {
5047  Py_ssize_t kw_args;
5048  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5049  switch (pos_args) {
5050  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5051  CYTHON_FALLTHROUGH;
5052  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5053  CYTHON_FALLTHROUGH;
5054  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5055  CYTHON_FALLTHROUGH;
5056  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5057  CYTHON_FALLTHROUGH;
5058  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5059  CYTHON_FALLTHROUGH;
5060  case 0: break;
5061  default: goto __pyx_L5_argtuple_error;
5062  }
5063  kw_args = PyDict_Size(__pyx_kwds);
5064  switch (pos_args) {
5065  case 0:
5066  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5067  else goto __pyx_L5_argtuple_error;
5068  CYTHON_FALLTHROUGH;
5069  case 1:
5070  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
5071  else {
5072  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 190, __pyx_L3_error)
5073  }
5074  CYTHON_FALLTHROUGH;
5075  case 2:
5076  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5077  else {
5078  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 190, __pyx_L3_error)
5079  }
5080  CYTHON_FALLTHROUGH;
5081  case 3:
5082  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5083  else {
5084  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 190, __pyx_L3_error)
5085  }
5086  CYTHON_FALLTHROUGH;
5087  case 4:
5088  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5089  else {
5090  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 190, __pyx_L3_error)
5091  }
5092  }
5093  if (unlikely(kw_args > 0)) {
5094  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 190, __pyx_L3_error)
5095  }
5096  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5097  goto __pyx_L5_argtuple_error;
5098  } else {
5099  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5100  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5101  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5102  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5103  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5104  }
5105  __pyx_v_A = values[0];
5106  __pyx_v_M = values[1];
5107  __pyx_v_R = values[2];
5108  __pyx_v_node_order = values[3];
5109  __pyx_v_dX = values[4];
5110  }
5111  goto __pyx_L4_argument_unpacking_done;
5112  __pyx_L5_argtuple_error:;
5113  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 190, __pyx_L3_error)
5114  __pyx_L3_error:;
5115  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5116  __Pyx_RefNannyFinishContext();
5117  return NULL;
5118  __pyx_L4_argument_unpacking_done:;
5119  __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
5120 
5121  /* function exit code */
5122  __Pyx_RefNannyFinishContext();
5123  return __pyx_r;
5124 }
5125 
5126 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
5127  PyObject *__pyx_r = NULL;
5128  __Pyx_RefNannyDeclarations
5129  PyObject *__pyx_t_1 = NULL;
5130  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5131  __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5132  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5133  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5134  int __pyx_lineno = 0;
5135  const char *__pyx_filename = NULL;
5136  int __pyx_clineno = 0;
5137  __Pyx_RefNannySetupContext("gauss_seidel_NR_solve", 0);
5138 
5139  /* "csmoothers.pyx":201
5140  * dX : np.array double
5141  * """
5142  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
5143  *
5144  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
5145  */
5146  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
5147  __Pyx_GOTREF(__pyx_t_1);
5148  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 201, __pyx_L1_error)
5149  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5150  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5151  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5152  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5153  __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
5154  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5155  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5156  __pyx_t_2.memview = NULL;
5157  __pyx_t_2.data = NULL;
5158  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5159  __pyx_t_3.memview = NULL;
5160  __pyx_t_3.data = NULL;
5161  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5162  __pyx_t_4.memview = NULL;
5163  __pyx_t_4.data = NULL;
5164  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5165  __pyx_t_5.memview = NULL;
5166  __pyx_t_5.data = NULL;
5167 
5168  /* "csmoothers.pyx":190
5169  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5170  *
5171  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
5172  * """
5173  *
5174  */
5175 
5176  /* function exit code */
5177  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5178  goto __pyx_L0;
5179  __pyx_L1_error:;
5180  __Pyx_XDECREF(__pyx_t_1);
5181  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5182  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5183  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5184  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5185  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5186  __pyx_r = NULL;
5187  __pyx_L0:;
5188  __Pyx_XGIVEREF(__pyx_r);
5189  __Pyx_RefNannyFinishContext();
5190  return __pyx_r;
5191 }
5192 
5193 /* "csmoothers.pyx":203
5194  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
5195  *
5196  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5197  * DDATA M,
5198  * DDATA R,
5199  */
5200 
5201 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5202  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5203  __Pyx_RefNannyDeclarations
5204  PyObject *__pyx_t_1 = NULL;
5205  int __pyx_t_2;
5206  Py_ssize_t __pyx_t_3;
5207  Py_ssize_t __pyx_t_4;
5208  Py_ssize_t __pyx_t_5;
5209  Py_ssize_t __pyx_t_6;
5210  int __pyx_lineno = 0;
5211  const char *__pyx_filename = NULL;
5212  int __pyx_clineno = 0;
5213  __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_solve", 0);
5214 
5215  /* "csmoothers.pyx":209
5216  * DDATA dX):
5217  * cdef SuperMatrix AS
5218  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5219  * AS.Dtype = superluWrappers._SLU_D
5220  * AS.Mtype = superluWrappers._SLU_GE
5221  */
5222  __pyx_v_AS.Stype = SLU_NR;
5223 
5224  /* "csmoothers.pyx":210
5225  * cdef SuperMatrix AS
5226  * AS.Stype = superluWrappers._SLU_NR
5227  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5228  * AS.Mtype = superluWrappers._SLU_GE
5229  * AS.nrow = sm.nr
5230  */
5231  __pyx_v_AS.Dtype = SLU_D;
5232 
5233  /* "csmoothers.pyx":211
5234  * AS.Stype = superluWrappers._SLU_NR
5235  * AS.Dtype = superluWrappers._SLU_D
5236  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5237  * AS.nrow = sm.nr
5238  * AS.ncol = sm.nc
5239  */
5240  __pyx_v_AS.Mtype = SLU_GE;
5241 
5242  /* "csmoothers.pyx":212
5243  * AS.Dtype = superluWrappers._SLU_D
5244  * AS.Mtype = superluWrappers._SLU_GE
5245  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5246  * AS.ncol = sm.nc
5247  * AS.Store = &sm.A
5248  */
5249  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
5250  __Pyx_GOTREF(__pyx_t_1);
5251  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
5252  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5253  __pyx_v_AS.nrow = __pyx_t_2;
5254 
5255  /* "csmoothers.pyx":213
5256  * AS.Mtype = superluWrappers._SLU_GE
5257  * AS.nrow = sm.nr
5258  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5259  * AS.Store = &sm.A
5260  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5261  */
5262  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
5263  __Pyx_GOTREF(__pyx_t_1);
5264  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5265  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5266  __pyx_v_AS.ncol = __pyx_t_2;
5267 
5268  /* "csmoothers.pyx":214
5269  * AS.nrow = sm.nr
5270  * AS.ncol = sm.nc
5271  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5272  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5273  *
5274  */
5275  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5276 
5277  /* "csmoothers.pyx":215
5278  * AS.ncol = sm.nc
5279  * AS.Store = &sm.A
5280  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
5281  *
5282  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX):
5283  */
5284  __pyx_t_3 = 0;
5285  __pyx_t_2 = -1;
5286  if (__pyx_t_3 < 0) {
5287  __pyx_t_3 += __pyx_v_M.shape[0];
5288  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5289  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5290  if (unlikely(__pyx_t_2 != -1)) {
5291  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5292  __PYX_ERR(0, 215, __pyx_L1_error)
5293  }
5294  __pyx_t_4 = 0;
5295  __pyx_t_2 = -1;
5296  if (__pyx_t_4 < 0) {
5297  __pyx_t_4 += __pyx_v_R.shape[0];
5298  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5299  } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5300  if (unlikely(__pyx_t_2 != -1)) {
5301  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5302  __PYX_ERR(0, 215, __pyx_L1_error)
5303  }
5304  __pyx_t_5 = 0;
5305  __pyx_t_2 = -1;
5306  if (__pyx_t_5 < 0) {
5307  __pyx_t_5 += __pyx_v_node_order.shape[0];
5308  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5309  } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5310  if (unlikely(__pyx_t_2 != -1)) {
5311  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5312  __PYX_ERR(0, 215, __pyx_L1_error)
5313  }
5314  __pyx_t_6 = 0;
5315  __pyx_t_2 = -1;
5316  if (__pyx_t_6 < 0) {
5317  __pyx_t_6 += __pyx_v_dX.shape[0];
5318  if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
5319  } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5320  if (unlikely(__pyx_t_2 != -1)) {
5321  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5322  __PYX_ERR(0, 215, __pyx_L1_error)
5323  }
5324  gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
5325 
5326  /* "csmoothers.pyx":203
5327  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
5328  *
5329  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5330  * DDATA M,
5331  * DDATA R,
5332  */
5333 
5334  /* function exit code */
5335  goto __pyx_L0;
5336  __pyx_L1_error:;
5337  __Pyx_XDECREF(__pyx_t_1);
5338  __Pyx_WriteUnraisable("csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5339  __pyx_L0:;
5340  __Pyx_RefNannyFinishContext();
5341 }
5342 
5343 /* "csmoothers.pyx":217
5344  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5345  *
5346  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
5347  * """
5348  *
5349  */
5350 
5351 /* Python wrapper */
5352 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5353 static char __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ";
5354 static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {"nl_gauss_seidel_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
5355 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5356  PyObject *__pyx_v_A = 0;
5357  PyObject *__pyx_v_R = 0;
5358  PyObject *__pyx_v_node_order = 0;
5359  PyObject *__pyx_v_w = 0;
5360  PyObject *__pyx_v_tol = 0;
5361  PyObject *__pyx_v_dX = 0;
5362  int __pyx_lineno = 0;
5363  const char *__pyx_filename = NULL;
5364  int __pyx_clineno = 0;
5365  PyObject *__pyx_r = 0;
5366  __Pyx_RefNannyDeclarations
5367  __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve (wrapper)", 0);
5368  {
5369  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
5370  PyObject* values[6] = {0,0,0,0,0,0};
5371  if (unlikely(__pyx_kwds)) {
5372  Py_ssize_t kw_args;
5373  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5374  switch (pos_args) {
5375  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5376  CYTHON_FALLTHROUGH;
5377  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5378  CYTHON_FALLTHROUGH;
5379  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5380  CYTHON_FALLTHROUGH;
5381  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5382  CYTHON_FALLTHROUGH;
5383  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5384  CYTHON_FALLTHROUGH;
5385  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5386  CYTHON_FALLTHROUGH;
5387  case 0: break;
5388  default: goto __pyx_L5_argtuple_error;
5389  }
5390  kw_args = PyDict_Size(__pyx_kwds);
5391  switch (pos_args) {
5392  case 0:
5393  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5394  else goto __pyx_L5_argtuple_error;
5395  CYTHON_FALLTHROUGH;
5396  case 1:
5397  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5398  else {
5399  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 217, __pyx_L3_error)
5400  }
5401  CYTHON_FALLTHROUGH;
5402  case 2:
5403  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5404  else {
5405  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 217, __pyx_L3_error)
5406  }
5407  CYTHON_FALLTHROUGH;
5408  case 3:
5409  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5410  else {
5411  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 217, __pyx_L3_error)
5412  }
5413  CYTHON_FALLTHROUGH;
5414  case 4:
5415  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
5416  else {
5417  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 217, __pyx_L3_error)
5418  }
5419  CYTHON_FALLTHROUGH;
5420  case 5:
5421  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5422  else {
5423  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 217, __pyx_L3_error)
5424  }
5425  }
5426  if (unlikely(kw_args > 0)) {
5427  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nl_gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
5428  }
5429  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5430  goto __pyx_L5_argtuple_error;
5431  } else {
5432  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5433  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5434  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5435  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5436  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5437  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5438  }
5439  __pyx_v_A = values[0];
5440  __pyx_v_R = values[1];
5441  __pyx_v_node_order = values[2];
5442  __pyx_v_w = values[3];
5443  __pyx_v_tol = values[4];
5444  __pyx_v_dX = values[5];
5445  }
5446  goto __pyx_L4_argument_unpacking_done;
5447  __pyx_L5_argtuple_error:;
5448  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
5449  __pyx_L3_error:;
5450  __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5451  __Pyx_RefNannyFinishContext();
5452  return NULL;
5453  __pyx_L4_argument_unpacking_done:;
5454  __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
5455 
5456  /* function exit code */
5457  __Pyx_RefNannyFinishContext();
5458  return __pyx_r;
5459 }
5460 
5461 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
5462  PyObject *__pyx_r = NULL;
5463  __Pyx_RefNannyDeclarations
5464  PyObject *__pyx_t_1 = NULL;
5465  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5466  __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5467  double __pyx_t_4;
5468  double __pyx_t_5;
5469  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5470  PyObject *__pyx_t_7 = NULL;
5471  int __pyx_lineno = 0;
5472  const char *__pyx_filename = NULL;
5473  int __pyx_clineno = 0;
5474  __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve", 0);
5475 
5476  /* "csmoothers.pyx":229
5477  * dX : np.array double
5478  * """
5479  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5480  * R,
5481  * node_order,
5482  */
5483  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5484  __Pyx_GOTREF(__pyx_t_1);
5485  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5486 
5487  /* "csmoothers.pyx":230
5488  * """
5489  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
5490  * R, # <<<<<<<<<<<<<<
5491  * node_order,
5492  * w,
5493  */
5494  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
5495 
5496  /* "csmoothers.pyx":231
5497  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
5498  * R,
5499  * node_order, # <<<<<<<<<<<<<<
5500  * w,
5501  * tol,
5502  */
5503  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
5504 
5505  /* "csmoothers.pyx":232
5506  * R,
5507  * node_order,
5508  * w, # <<<<<<<<<<<<<<
5509  * tol,
5510  * dX)
5511  */
5512  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
5513 
5514  /* "csmoothers.pyx":233
5515  * node_order,
5516  * w,
5517  * tol, # <<<<<<<<<<<<<<
5518  * dX)
5519  *
5520  */
5521  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
5522 
5523  /* "csmoothers.pyx":234
5524  * w,
5525  * tol,
5526  * dX) # <<<<<<<<<<<<<<
5527  *
5528  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
5529  */
5530  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 234, __pyx_L1_error)
5531 
5532  /* "csmoothers.pyx":229
5533  * dX : np.array double
5534  * """
5535  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5536  * R,
5537  * node_order,
5538  */
5539  __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
5540  __Pyx_GOTREF(__pyx_t_7);
5541  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5542  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5543  __pyx_t_2.memview = NULL;
5544  __pyx_t_2.data = NULL;
5545  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5546  __pyx_t_3.memview = NULL;
5547  __pyx_t_3.data = NULL;
5548  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5549  __pyx_t_6.memview = NULL;
5550  __pyx_t_6.data = NULL;
5551  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5552 
5553  /* "csmoothers.pyx":217
5554  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5555  *
5556  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
5557  * """
5558  *
5559  */
5560 
5561  /* function exit code */
5562  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5563  goto __pyx_L0;
5564  __pyx_L1_error:;
5565  __Pyx_XDECREF(__pyx_t_1);
5566  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5567  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5568  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5569  __Pyx_XDECREF(__pyx_t_7);
5570  __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5571  __pyx_r = NULL;
5572  __pyx_L0:;
5573  __Pyx_XGIVEREF(__pyx_r);
5574  __Pyx_RefNannyFinishContext();
5575  return __pyx_r;
5576 }
5577 
5578 /* "csmoothers.pyx":236
5579  * dX)
5580  *
5581  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5582  * DDATA R,
5583  * IDATA node_order,
5584  */
5585 
5586 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5587  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5588  PyObject *__pyx_r = NULL;
5589  __Pyx_RefNannyDeclarations
5590  PyObject *__pyx_t_1 = NULL;
5591  int __pyx_t_2;
5592  Py_ssize_t __pyx_t_3;
5593  Py_ssize_t __pyx_t_4;
5594  Py_ssize_t __pyx_t_5;
5595  int __pyx_lineno = 0;
5596  const char *__pyx_filename = NULL;
5597  int __pyx_clineno = 0;
5598  __Pyx_RefNannySetupContext("smootherWrappers_nl_gauss_seidel_NR_solve", 0);
5599 
5600  /* "csmoothers.pyx":243
5601  * DDATA dX):
5602  * cdef SuperMatrix AS
5603  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5604  * AS.Dtype = superluWrappers._SLU_D
5605  * AS.Mtype = superluWrappers._SLU_GE
5606  */
5607  __pyx_v_AS.Stype = SLU_NR;
5608 
5609  /* "csmoothers.pyx":244
5610  * cdef SuperMatrix AS
5611  * AS.Stype = superluWrappers._SLU_NR
5612  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5613  * AS.Mtype = superluWrappers._SLU_GE
5614  * AS.nrow = sm.nr
5615  */
5616  __pyx_v_AS.Dtype = SLU_D;
5617 
5618  /* "csmoothers.pyx":245
5619  * AS.Stype = superluWrappers._SLU_NR
5620  * AS.Dtype = superluWrappers._SLU_D
5621  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5622  * AS.nrow = sm.nr
5623  * AS.ncol = sm.nc
5624  */
5625  __pyx_v_AS.Mtype = SLU_GE;
5626 
5627  /* "csmoothers.pyx":246
5628  * AS.Dtype = superluWrappers._SLU_D
5629  * AS.Mtype = superluWrappers._SLU_GE
5630  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5631  * AS.ncol = sm.nc
5632  * AS.Store = &sm.A
5633  */
5634  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
5635  __Pyx_GOTREF(__pyx_t_1);
5636  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
5637  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5638  __pyx_v_AS.nrow = __pyx_t_2;
5639 
5640  /* "csmoothers.pyx":247
5641  * AS.Mtype = superluWrappers._SLU_GE
5642  * AS.nrow = sm.nr
5643  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5644  * AS.Store = &sm.A
5645  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5646  */
5647  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
5648  __Pyx_GOTREF(__pyx_t_1);
5649  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
5650  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5651  __pyx_v_AS.ncol = __pyx_t_2;
5652 
5653  /* "csmoothers.pyx":248
5654  * AS.nrow = sm.nr
5655  * AS.ncol = sm.nc
5656  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5657  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5658  *
5659  */
5660  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5661 
5662  /* "csmoothers.pyx":249
5663  * AS.ncol = sm.nc
5664  * AS.Store = &sm.A
5665  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
5666  *
5667  * def asm_NR_prepare(A, asmFactor):
5668  */
5669  __pyx_t_3 = 0;
5670  __pyx_t_2 = -1;
5671  if (__pyx_t_3 < 0) {
5672  __pyx_t_3 += __pyx_v_R.shape[0];
5673  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5674  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5675  if (unlikely(__pyx_t_2 != -1)) {
5676  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5677  __PYX_ERR(0, 249, __pyx_L1_error)
5678  }
5679  __pyx_t_4 = 0;
5680  __pyx_t_2 = -1;
5681  if (__pyx_t_4 < 0) {
5682  __pyx_t_4 += __pyx_v_node_order.shape[0];
5683  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5684  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5685  if (unlikely(__pyx_t_2 != -1)) {
5686  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5687  __PYX_ERR(0, 249, __pyx_L1_error)
5688  }
5689  __pyx_t_5 = 0;
5690  __pyx_t_2 = -1;
5691  if (__pyx_t_5 < 0) {
5692  __pyx_t_5 += __pyx_v_dX.shape[0];
5693  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5694  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5695  if (unlikely(__pyx_t_2 != -1)) {
5696  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5697  __PYX_ERR(0, 249, __pyx_L1_error)
5698  }
5699  nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
5700 
5701  /* "csmoothers.pyx":236
5702  * dX)
5703  *
5704  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5705  * DDATA R,
5706  * IDATA node_order,
5707  */
5708 
5709  /* function exit code */
5710  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5711  goto __pyx_L0;
5712  __pyx_L1_error:;
5713  __Pyx_XDECREF(__pyx_t_1);
5714  __Pyx_AddTraceback("csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5715  __pyx_r = 0;
5716  __pyx_L0:;
5717  __Pyx_XGIVEREF(__pyx_r);
5718  __Pyx_RefNannyFinishContext();
5719  return __pyx_r;
5720 }
5721 
5722 /* "csmoothers.pyx":251
5723  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5724  *
5725  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
5726  * """
5727  *
5728  */
5729 
5730 /* Python wrapper */
5731 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5732 static char __pyx_doc_10csmoothers_12asm_NR_prepare[] = "\n\n Arguments\n ---------\n A :\n asmFactor :\n ";
5733 static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {"asm_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_13asm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
5734 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5735  PyObject *__pyx_v_A = 0;
5736  PyObject *__pyx_v_asmFactor = 0;
5737  int __pyx_lineno = 0;
5738  const char *__pyx_filename = NULL;
5739  int __pyx_clineno = 0;
5740  PyObject *__pyx_r = 0;
5741  __Pyx_RefNannyDeclarations
5742  __Pyx_RefNannySetupContext("asm_NR_prepare (wrapper)", 0);
5743  {
5744  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_asmFactor,0};
5745  PyObject* values[2] = {0,0};
5746  if (unlikely(__pyx_kwds)) {
5747  Py_ssize_t kw_args;
5748  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5749  switch (pos_args) {
5750  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5751  CYTHON_FALLTHROUGH;
5752  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5753  CYTHON_FALLTHROUGH;
5754  case 0: break;
5755  default: goto __pyx_L5_argtuple_error;
5756  }
5757  kw_args = PyDict_Size(__pyx_kwds);
5758  switch (pos_args) {
5759  case 0:
5760  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5761  else goto __pyx_L5_argtuple_error;
5762  CYTHON_FALLTHROUGH;
5763  case 1:
5764  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5765  else {
5766  __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error)
5767  }
5768  }
5769  if (unlikely(kw_args > 0)) {
5770  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asm_NR_prepare") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
5771  }
5772  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5773  goto __pyx_L5_argtuple_error;
5774  } else {
5775  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5776  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5777  }
5778  __pyx_v_A = values[0];
5779  __pyx_v_asmFactor = values[1];
5780  }
5781  goto __pyx_L4_argument_unpacking_done;
5782  __pyx_L5_argtuple_error:;
5783  __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error)
5784  __pyx_L3_error:;
5785  __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5786  __Pyx_RefNannyFinishContext();
5787  return NULL;
5788  __pyx_L4_argument_unpacking_done:;
5789  __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
5790 
5791  /* function exit code */
5792  __Pyx_RefNannyFinishContext();
5793  return __pyx_r;
5794 }
5795 
5796 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
5797  PyObject *__pyx_r = NULL;
5798  __Pyx_RefNannyDeclarations
5799  PyObject *__pyx_t_1 = NULL;
5800  PyObject *__pyx_t_2 = NULL;
5801  int __pyx_lineno = 0;
5802  const char *__pyx_filename = NULL;
5803  int __pyx_clineno = 0;
5804  __Pyx_RefNannySetupContext("asm_NR_prepare", 0);
5805 
5806  /* "csmoothers.pyx":259
5807  * asmFactor :
5808  * """
5809  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
5810  * asmFactor._cASMFactor)
5811  *
5812  */
5813  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
5814  __Pyx_GOTREF(__pyx_t_1);
5815  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 259, __pyx_L1_error)
5816 
5817  /* "csmoothers.pyx":260
5818  * """
5819  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix,
5820  * asmFactor._cASMFactor) # <<<<<<<<<<<<<<
5821  *
5822  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm,
5823  */
5824  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
5825  __Pyx_GOTREF(__pyx_t_2);
5826  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 260, __pyx_L1_error)
5827 
5828  /* "csmoothers.pyx":259
5829  * asmFactor :
5830  * """
5831  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
5832  * asmFactor._cASMFactor)
5833  *
5834  */
5835  __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2));
5836  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5837  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5838 
5839  /* "csmoothers.pyx":251
5840  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5841  *
5842  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
5843  * """
5844  *
5845  */
5846 
5847  /* function exit code */
5848  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5849  goto __pyx_L0;
5850  __pyx_L1_error:;
5851  __Pyx_XDECREF(__pyx_t_1);
5852  __Pyx_XDECREF(__pyx_t_2);
5853  __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5854  __pyx_r = NULL;
5855  __pyx_L0:;
5856  __Pyx_XGIVEREF(__pyx_r);
5857  __Pyx_RefNannyFinishContext();
5858  return __pyx_r;
5859 }
5860 
5861 /* "csmoothers.pyx":262
5862  * asmFactor._cASMFactor)
5863  *
5864  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5865  * cASMFactor asmFactor):
5866  * cdef SuperMatrix AS
5867  */
5868 
5869 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
5870  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5871  __Pyx_RefNannyDeclarations
5872  PyObject *__pyx_t_1 = NULL;
5873  int __pyx_t_2;
5874  int __pyx_lineno = 0;
5875  const char *__pyx_filename = NULL;
5876  int __pyx_clineno = 0;
5877  __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_prepare", 0);
5878 
5879  /* "csmoothers.pyx":265
5880  * cASMFactor asmFactor):
5881  * cdef SuperMatrix AS
5882  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5883  * AS.Dtype = superluWrappers._SLU_D
5884  * AS.Mtype = superluWrappers._SLU_GE
5885  */
5886  __pyx_v_AS.Stype = SLU_NR;
5887 
5888  /* "csmoothers.pyx":266
5889  * cdef SuperMatrix AS
5890  * AS.Stype = superluWrappers._SLU_NR
5891  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5892  * AS.Mtype = superluWrappers._SLU_GE
5893  * AS.nrow = sm.nr
5894  */
5895  __pyx_v_AS.Dtype = SLU_D;
5896 
5897  /* "csmoothers.pyx":267
5898  * AS.Stype = superluWrappers._SLU_NR
5899  * AS.Dtype = superluWrappers._SLU_D
5900  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5901  * AS.nrow = sm.nr
5902  * AS.ncol = sm.nc
5903  */
5904  __pyx_v_AS.Mtype = SLU_GE;
5905 
5906  /* "csmoothers.pyx":268
5907  * AS.Dtype = superluWrappers._SLU_D
5908  * AS.Mtype = superluWrappers._SLU_GE
5909  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5910  * AS.ncol = sm.nc
5911  * AS.Store = &sm.A
5912  */
5913  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
5914  __Pyx_GOTREF(__pyx_t_1);
5915  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
5916  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5917  __pyx_v_AS.nrow = __pyx_t_2;
5918 
5919  /* "csmoothers.pyx":269
5920  * AS.Mtype = superluWrappers._SLU_GE
5921  * AS.nrow = sm.nr
5922  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5923  * AS.Store = &sm.A
5924  * casm_NR_prepare(&AS,
5925  */
5926  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
5927  __Pyx_GOTREF(__pyx_t_1);
5928  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5929  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5930  __pyx_v_AS.ncol = __pyx_t_2;
5931 
5932  /* "csmoothers.pyx":270
5933  * AS.nrow = sm.nr
5934  * AS.ncol = sm.nc
5935  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5936  * casm_NR_prepare(&AS,
5937  * asmFactor.subdomain_dim,
5938  */
5939  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5940 
5941  /* "csmoothers.pyx":271
5942  * AS.ncol = sm.nc
5943  * AS.Store = &sm.A
5944  * casm_NR_prepare(&AS, # <<<<<<<<<<<<<<
5945  * asmFactor.subdomain_dim,
5946  * asmFactor.l2g_L,
5947  */
5948  asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
5949 
5950  /* "csmoothers.pyx":262
5951  * asmFactor._cASMFactor)
5952  *
5953  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5954  * cASMFactor asmFactor):
5955  * cdef SuperMatrix AS
5956  */
5957 
5958  /* function exit code */
5959  goto __pyx_L0;
5960  __pyx_L1_error:;
5961  __Pyx_XDECREF(__pyx_t_1);
5962  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5963  __pyx_L0:;
5964  __Pyx_RefNannyFinishContext();
5965 }
5966 
5967 /* "csmoothers.pyx":277
5968  * asmFactor.subdomain_pivots)
5969  *
5970  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
5971  * """
5972  *
5973  */
5974 
5975 /* Python wrapper */
5976 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5977 static char __pyx_doc_10csmoothers_14asm_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ";
5978 static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {"asm_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_15asm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
5979 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5980  PyObject *__pyx_v_A = 0;
5981  PyObject *__pyx_v_w = 0;
5982  PyObject *__pyx_v_asmFactor = 0;
5983  PyObject *__pyx_v_node_order = 0;
5984  PyObject *__pyx_v_R = 0;
5985  PyObject *__pyx_v_dX = 0;
5986  int __pyx_lineno = 0;
5987  const char *__pyx_filename = NULL;
5988  int __pyx_clineno = 0;
5989  PyObject *__pyx_r = 0;
5990  __Pyx_RefNannyDeclarations
5991  __Pyx_RefNannySetupContext("asm_NR_solve (wrapper)", 0);
5992  {
5993  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_asmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
5994  PyObject* values[6] = {0,0,0,0,0,0};
5995  if (unlikely(__pyx_kwds)) {
5996  Py_ssize_t kw_args;
5997  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5998  switch (pos_args) {
5999  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6000  CYTHON_FALLTHROUGH;
6001  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6002  CYTHON_FALLTHROUGH;
6003  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6004  CYTHON_FALLTHROUGH;
6005  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6006  CYTHON_FALLTHROUGH;
6007  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6008  CYTHON_FALLTHROUGH;
6009  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6010  CYTHON_FALLTHROUGH;
6011  case 0: break;
6012  default: goto __pyx_L5_argtuple_error;
6013  }
6014  kw_args = PyDict_Size(__pyx_kwds);
6015  switch (pos_args) {
6016  case 0:
6017  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6018  else goto __pyx_L5_argtuple_error;
6019  CYTHON_FALLTHROUGH;
6020  case 1:
6021  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6022  else {
6023  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 277, __pyx_L3_error)
6024  }
6025  CYTHON_FALLTHROUGH;
6026  case 2:
6027  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
6028  else {
6029  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 277, __pyx_L3_error)
6030  }
6031  CYTHON_FALLTHROUGH;
6032  case 3:
6033  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6034  else {
6035  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 277, __pyx_L3_error)
6036  }
6037  CYTHON_FALLTHROUGH;
6038  case 4:
6039  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6040  else {
6041  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 277, __pyx_L3_error)
6042  }
6043  CYTHON_FALLTHROUGH;
6044  case 5:
6045  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6046  else {
6047  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 277, __pyx_L3_error)
6048  }
6049  }
6050  if (unlikely(kw_args > 0)) {
6051  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asm_NR_solve") < 0)) __PYX_ERR(0, 277, __pyx_L3_error)
6052  }
6053  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6054  goto __pyx_L5_argtuple_error;
6055  } else {
6056  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6057  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6058  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6059  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6060  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6061  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6062  }
6063  __pyx_v_A = values[0];
6064  __pyx_v_w = values[1];
6065  __pyx_v_asmFactor = values[2];
6066  __pyx_v_node_order = values[3];
6067  __pyx_v_R = values[4];
6068  __pyx_v_dX = values[5];
6069  }
6070  goto __pyx_L4_argument_unpacking_done;
6071  __pyx_L5_argtuple_error:;
6072  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error)
6073  __pyx_L3_error:;
6074  __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6075  __Pyx_RefNannyFinishContext();
6076  return NULL;
6077  __pyx_L4_argument_unpacking_done:;
6078  __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6079 
6080  /* function exit code */
6081  __Pyx_RefNannyFinishContext();
6082  return __pyx_r;
6083 }
6084 
6085 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6086  PyObject *__pyx_r = NULL;
6087  __Pyx_RefNannyDeclarations
6088  PyObject *__pyx_t_1 = NULL;
6089  double __pyx_t_2;
6090  PyObject *__pyx_t_3 = NULL;
6091  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6092  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6093  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6094  int __pyx_lineno = 0;
6095  const char *__pyx_filename = NULL;
6096  int __pyx_clineno = 0;
6097  __Pyx_RefNannySetupContext("asm_NR_solve", 0);
6098 
6099  /* "csmoothers.pyx":289
6100  * dX : np.array double
6101  * """
6102  * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6103  * w,
6104  * asmFactor._cASMFactor,
6105  */
6106  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
6107  __Pyx_GOTREF(__pyx_t_1);
6108  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 289, __pyx_L1_error)
6109 
6110  /* "csmoothers.pyx":290
6111  * """
6112  * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
6113  * w, # <<<<<<<<<<<<<<
6114  * asmFactor._cASMFactor,
6115  * node_order,
6116  */
6117  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
6118 
6119  /* "csmoothers.pyx":291
6120  * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
6121  * w,
6122  * asmFactor._cASMFactor, # <<<<<<<<<<<<<<
6123  * node_order,
6124  * R,
6125  */
6126  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
6127  __Pyx_GOTREF(__pyx_t_3);
6128  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 291, __pyx_L1_error)
6129 
6130  /* "csmoothers.pyx":292
6131  * w,
6132  * asmFactor._cASMFactor,
6133  * node_order, # <<<<<<<<<<<<<<
6134  * R,
6135  * dX)
6136  */
6137  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 292, __pyx_L1_error)
6138 
6139  /* "csmoothers.pyx":293
6140  * asmFactor._cASMFactor,
6141  * node_order,
6142  * R, # <<<<<<<<<<<<<<
6143  * dX)
6144  *
6145  */
6146  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
6147 
6148  /* "csmoothers.pyx":294
6149  * node_order,
6150  * R,
6151  * dX) # <<<<<<<<<<<<<<
6152  *
6153  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm,
6154  */
6155  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
6156 
6157  /* "csmoothers.pyx":289
6158  * dX : np.array double
6159  * """
6160  * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6161  * w,
6162  * asmFactor._cASMFactor,
6163  */
6164  __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6165  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6166  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6167  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6168  __pyx_t_4.memview = NULL;
6169  __pyx_t_4.data = NULL;
6170  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6171  __pyx_t_5.memview = NULL;
6172  __pyx_t_5.data = NULL;
6173  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6174  __pyx_t_6.memview = NULL;
6175  __pyx_t_6.data = NULL;
6176 
6177  /* "csmoothers.pyx":277
6178  * asmFactor.subdomain_pivots)
6179  *
6180  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6181  * """
6182  *
6183  */
6184 
6185  /* function exit code */
6186  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6187  goto __pyx_L0;
6188  __pyx_L1_error:;
6189  __Pyx_XDECREF(__pyx_t_1);
6190  __Pyx_XDECREF(__pyx_t_3);
6191  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6192  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6193  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6194  __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6195  __pyx_r = NULL;
6196  __pyx_L0:;
6197  __Pyx_XGIVEREF(__pyx_r);
6198  __Pyx_RefNannyFinishContext();
6199  return __pyx_r;
6200 }
6201 
6202 /* "csmoothers.pyx":296
6203  * dX)
6204  *
6205  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6206  * double w,
6207  * cASMFactor asmFactor,
6208  */
6209 
6210 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6211  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6212  __Pyx_RefNannyDeclarations
6213  PyObject *__pyx_t_1 = NULL;
6214  int __pyx_t_2;
6215  Py_ssize_t __pyx_t_3;
6216  Py_ssize_t __pyx_t_4;
6217  Py_ssize_t __pyx_t_5;
6218  int __pyx_lineno = 0;
6219  const char *__pyx_filename = NULL;
6220  int __pyx_clineno = 0;
6221  __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_solve", 0);
6222 
6223  /* "csmoothers.pyx":303
6224  * DDATA dX):
6225  * cdef SuperMatrix AS
6226  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
6227  * AS.Dtype = superluWrappers._SLU_D
6228  * AS.Mtype = superluWrappers._SLU_GE
6229  */
6230  __pyx_v_AS.Stype = SLU_NR;
6231 
6232  /* "csmoothers.pyx":304
6233  * cdef SuperMatrix AS
6234  * AS.Stype = superluWrappers._SLU_NR
6235  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6236  * AS.Mtype = superluWrappers._SLU_GE
6237  * AS.nrow = sm.nr
6238  */
6239  __pyx_v_AS.Dtype = SLU_D;
6240 
6241  /* "csmoothers.pyx":305
6242  * AS.Stype = superluWrappers._SLU_NR
6243  * AS.Dtype = superluWrappers._SLU_D
6244  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6245  * AS.nrow = sm.nr
6246  * AS.ncol = sm.nc
6247  */
6248  __pyx_v_AS.Mtype = SLU_GE;
6249 
6250  /* "csmoothers.pyx":306
6251  * AS.Dtype = superluWrappers._SLU_D
6252  * AS.Mtype = superluWrappers._SLU_GE
6253  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6254  * AS.ncol = sm.nc
6255  * AS.Store = &sm.A
6256  */
6257  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
6258  __Pyx_GOTREF(__pyx_t_1);
6259  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
6260  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6261  __pyx_v_AS.nrow = __pyx_t_2;
6262 
6263  /* "csmoothers.pyx":307
6264  * AS.Mtype = superluWrappers._SLU_GE
6265  * AS.nrow = sm.nr
6266  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6267  * AS.Store = &sm.A
6268  * casm_NR_solve(&AS,
6269  */
6270  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
6271  __Pyx_GOTREF(__pyx_t_1);
6272  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
6273  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6274  __pyx_v_AS.ncol = __pyx_t_2;
6275 
6276  /* "csmoothers.pyx":308
6277  * AS.nrow = sm.nr
6278  * AS.ncol = sm.nc
6279  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6280  * casm_NR_solve(&AS,
6281  * w,
6282  */
6283  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6284 
6285  /* "csmoothers.pyx":314
6286  * asmFactor.subdomain_dim,
6287  * asmFactor.l2g_L,
6288  * &R[0], # <<<<<<<<<<<<<<
6289  * asmFactor.subdomain_R,
6290  * &node_order[0],
6291  */
6292  __pyx_t_3 = 0;
6293  __pyx_t_2 = -1;
6294  if (__pyx_t_3 < 0) {
6295  __pyx_t_3 += __pyx_v_R.shape[0];
6296  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6297  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6298  if (unlikely(__pyx_t_2 != -1)) {
6299  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6300  __PYX_ERR(0, 314, __pyx_L1_error)
6301  }
6302 
6303  /* "csmoothers.pyx":316
6304  * &R[0],
6305  * asmFactor.subdomain_R,
6306  * &node_order[0], # <<<<<<<<<<<<<<
6307  * asmFactor.subdomain_dX,
6308  * &dX[0],
6309  */
6310  __pyx_t_4 = 0;
6311  __pyx_t_2 = -1;
6312  if (__pyx_t_4 < 0) {
6313  __pyx_t_4 += __pyx_v_node_order.shape[0];
6314  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6315  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6316  if (unlikely(__pyx_t_2 != -1)) {
6317  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6318  __PYX_ERR(0, 316, __pyx_L1_error)
6319  }
6320 
6321  /* "csmoothers.pyx":318
6322  * &node_order[0],
6323  * asmFactor.subdomain_dX,
6324  * &dX[0], # <<<<<<<<<<<<<<
6325  * asmFactor.subdomain_pivots)
6326  *
6327  */
6328  __pyx_t_5 = 0;
6329  __pyx_t_2 = -1;
6330  if (__pyx_t_5 < 0) {
6331  __pyx_t_5 += __pyx_v_dX.shape[0];
6332  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6333  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6334  if (unlikely(__pyx_t_2 != -1)) {
6335  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6336  __PYX_ERR(0, 318, __pyx_L1_error)
6337  }
6338 
6339  /* "csmoothers.pyx":309
6340  * AS.ncol = sm.nc
6341  * AS.Store = &sm.A
6342  * casm_NR_solve(&AS, # <<<<<<<<<<<<<<
6343  * w,
6344  * asmFactor.subdomain_L,
6345  */
6346  asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
6347 
6348  /* "csmoothers.pyx":296
6349  * dX)
6350  *
6351  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6352  * double w,
6353  * cASMFactor asmFactor,
6354  */
6355 
6356  /* function exit code */
6357  goto __pyx_L0;
6358  __pyx_L1_error:;
6359  __Pyx_XDECREF(__pyx_t_1);
6360  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6361  __pyx_L0:;
6362  __Pyx_RefNannyFinishContext();
6363 }
6364 
6365 /* "csmoothers.pyx":321
6366  * asmFactor.subdomain_pivots)
6367  *
6368  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
6369  * """
6370  *
6371  */
6372 
6373 /* Python wrapper */
6374 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6375 static char __pyx_doc_10csmoothers_16basm_NR_prepare[] = "\n\n Arguments\n ---------\n A :\n basmFactor :\n ";
6376 static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {"basm_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_17basm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
6377 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6378  PyObject *__pyx_v_A = 0;
6379  PyObject *__pyx_v_basmFactor = 0;
6380  int __pyx_lineno = 0;
6381  const char *__pyx_filename = NULL;
6382  int __pyx_clineno = 0;
6383  PyObject *__pyx_r = 0;
6384  __Pyx_RefNannyDeclarations
6385  __Pyx_RefNannySetupContext("basm_NR_prepare (wrapper)", 0);
6386  {
6387  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_basmFactor,0};
6388  PyObject* values[2] = {0,0};
6389  if (unlikely(__pyx_kwds)) {
6390  Py_ssize_t kw_args;
6391  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6392  switch (pos_args) {
6393  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6394  CYTHON_FALLTHROUGH;
6395  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6396  CYTHON_FALLTHROUGH;
6397  case 0: break;
6398  default: goto __pyx_L5_argtuple_error;
6399  }
6400  kw_args = PyDict_Size(__pyx_kwds);
6401  switch (pos_args) {
6402  case 0:
6403  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6404  else goto __pyx_L5_argtuple_error;
6405  CYTHON_FALLTHROUGH;
6406  case 1:
6407  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6408  else {
6409  __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 321, __pyx_L3_error)
6410  }
6411  }
6412  if (unlikely(kw_args > 0)) {
6413  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "basm_NR_prepare") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
6414  }
6415  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6416  goto __pyx_L5_argtuple_error;
6417  } else {
6418  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6419  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6420  }
6421  __pyx_v_A = values[0];
6422  __pyx_v_basmFactor = values[1];
6423  }
6424  goto __pyx_L4_argument_unpacking_done;
6425  __pyx_L5_argtuple_error:;
6426  __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
6427  __pyx_L3_error:;
6428  __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6429  __Pyx_RefNannyFinishContext();
6430  return NULL;
6431  __pyx_L4_argument_unpacking_done:;
6432  __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
6433 
6434  /* function exit code */
6435  __Pyx_RefNannyFinishContext();
6436  return __pyx_r;
6437 }
6438 
6439 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
6440  PyObject *__pyx_r = NULL;
6441  __Pyx_RefNannyDeclarations
6442  PyObject *__pyx_t_1 = NULL;
6443  PyObject *__pyx_t_2 = NULL;
6444  int __pyx_lineno = 0;
6445  const char *__pyx_filename = NULL;
6446  int __pyx_clineno = 0;
6447  __Pyx_RefNannySetupContext("basm_NR_prepare", 0);
6448 
6449  /* "csmoothers.pyx":329
6450  * basmFactor :
6451  * """
6452  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
6453  * basmFactor._cBASMFactor)
6454  *
6455  */
6456  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
6457  __Pyx_GOTREF(__pyx_t_1);
6458  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 329, __pyx_L1_error)
6459 
6460  /* "csmoothers.pyx":330
6461  * """
6462  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix,
6463  * basmFactor._cBASMFactor) # <<<<<<<<<<<<<<
6464  *
6465  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm,
6466  */
6467  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
6468  __Pyx_GOTREF(__pyx_t_2);
6469  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 330, __pyx_L1_error)
6470 
6471  /* "csmoothers.pyx":329
6472  * basmFactor :
6473  * """
6474  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
6475  * basmFactor._cBASMFactor)
6476  *
6477  */
6478  __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_2));
6479  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6480  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6481 
6482  /* "csmoothers.pyx":321
6483  * asmFactor.subdomain_pivots)
6484  *
6485  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
6486  * """
6487  *
6488  */
6489 
6490  /* function exit code */
6491  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6492  goto __pyx_L0;
6493  __pyx_L1_error:;
6494  __Pyx_XDECREF(__pyx_t_1);
6495  __Pyx_XDECREF(__pyx_t_2);
6496  __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6497  __pyx_r = NULL;
6498  __pyx_L0:;
6499  __Pyx_XGIVEREF(__pyx_r);
6500  __Pyx_RefNannyFinishContext();
6501  return __pyx_r;
6502 }
6503 
6504 /* "csmoothers.pyx":332
6505  * basmFactor._cBASMFactor)
6506  *
6507  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6508  * cBASMFactor basmFactor):
6509  * cdef SuperMatrix AS
6510  */
6511 
6512 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor) {
6513  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6514  __Pyx_RefNannyDeclarations
6515  PyObject *__pyx_t_1 = NULL;
6516  int __pyx_t_2;
6517  int __pyx_lineno = 0;
6518  const char *__pyx_filename = NULL;
6519  int __pyx_clineno = 0;
6520  __Pyx_RefNannySetupContext("smootherWrappers_basm_NR_prepare", 0);
6521 
6522  /* "csmoothers.pyx":335
6523  * cBASMFactor basmFactor):
6524  * cdef SuperMatrix AS
6525  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6526  * AS.Mtype = superluWrappers._SLU_GE
6527  * AS.nrow = sm.nr
6528  */
6529  __pyx_v_AS.Dtype = SLU_D;
6530 
6531  /* "csmoothers.pyx":336
6532  * cdef SuperMatrix AS
6533  * AS.Dtype = superluWrappers._SLU_D
6534  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6535  * AS.nrow = sm.nr
6536  * AS.ncol = sm.nc
6537  */
6538  __pyx_v_AS.Mtype = SLU_GE;
6539 
6540  /* "csmoothers.pyx":337
6541  * AS.Dtype = superluWrappers._SLU_D
6542  * AS.Mtype = superluWrappers._SLU_GE
6543  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6544  * AS.ncol = sm.nc
6545  * AS.Store = &sm.A
6546  */
6547  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
6548  __Pyx_GOTREF(__pyx_t_1);
6549  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
6550  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6551  __pyx_v_AS.nrow = __pyx_t_2;
6552 
6553  /* "csmoothers.pyx":338
6554  * AS.Mtype = superluWrappers._SLU_GE
6555  * AS.nrow = sm.nr
6556  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6557  * AS.Store = &sm.A
6558  * cbasm_NR_prepare(basmFactor.bs,
6559  */
6560  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
6561  __Pyx_GOTREF(__pyx_t_1);
6562  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
6563  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6564  __pyx_v_AS.ncol = __pyx_t_2;
6565 
6566  /* "csmoothers.pyx":339
6567  * AS.nrow = sm.nr
6568  * AS.ncol = sm.nc
6569  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6570  * cbasm_NR_prepare(basmFactor.bs,
6571  * basmFactor.N,
6572  */
6573  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6574 
6575  /* "csmoothers.pyx":340
6576  * AS.ncol = sm.nc
6577  * AS.Store = &sm.A
6578  * cbasm_NR_prepare(basmFactor.bs, # <<<<<<<<<<<<<<
6579  * basmFactor.N,
6580  * &AS,
6581  */
6582  basm_NR_prepare(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6583 
6584  /* "csmoothers.pyx":332
6585  * basmFactor._cBASMFactor)
6586  *
6587  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6588  * cBASMFactor basmFactor):
6589  * cdef SuperMatrix AS
6590  */
6591 
6592  /* function exit code */
6593  goto __pyx_L0;
6594  __pyx_L1_error:;
6595  __Pyx_XDECREF(__pyx_t_1);
6596  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6597  __pyx_L0:;
6598  __Pyx_RefNannyFinishContext();
6599 }
6600 
6601 /* "csmoothers.pyx":350
6602  *
6603  *
6604  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6605  * """
6606  *
6607  */
6608 
6609 /* Python wrapper */
6610 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6611 static char __pyx_doc_10csmoothers_18basm_NR_solve[] = "\n \n Arguments\n ---------\n A :\n w :\n basmFactor :\n node_order :\n R :\n dX :\n ";
6612 static PyMethodDef __pyx_mdef_10csmoothers_19basm_NR_solve = {"basm_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_19basm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_18basm_NR_solve};
6613 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6614  PyObject *__pyx_v_A = 0;
6615  PyObject *__pyx_v_w = 0;
6616  PyObject *__pyx_v_basmFactor = 0;
6617  PyObject *__pyx_v_node_order = 0;
6618  PyObject *__pyx_v_R = 0;
6619  PyObject *__pyx_v_dX = 0;
6620  int __pyx_lineno = 0;
6621  const char *__pyx_filename = NULL;
6622  int __pyx_clineno = 0;
6623  PyObject *__pyx_r = 0;
6624  __Pyx_RefNannyDeclarations
6625  __Pyx_RefNannySetupContext("basm_NR_solve (wrapper)", 0);
6626  {
6627  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_basmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6628  PyObject* values[6] = {0,0,0,0,0,0};
6629  if (unlikely(__pyx_kwds)) {
6630  Py_ssize_t kw_args;
6631  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6632  switch (pos_args) {
6633  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6634  CYTHON_FALLTHROUGH;
6635  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6636  CYTHON_FALLTHROUGH;
6637  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6638  CYTHON_FALLTHROUGH;
6639  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6640  CYTHON_FALLTHROUGH;
6641  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6642  CYTHON_FALLTHROUGH;
6643  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6644  CYTHON_FALLTHROUGH;
6645  case 0: break;
6646  default: goto __pyx_L5_argtuple_error;
6647  }
6648  kw_args = PyDict_Size(__pyx_kwds);
6649  switch (pos_args) {
6650  case 0:
6651  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6652  else goto __pyx_L5_argtuple_error;
6653  CYTHON_FALLTHROUGH;
6654  case 1:
6655  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6656  else {
6657  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 350, __pyx_L3_error)
6658  }
6659  CYTHON_FALLTHROUGH;
6660  case 2:
6661  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6662  else {
6663  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 350, __pyx_L3_error)
6664  }
6665  CYTHON_FALLTHROUGH;
6666  case 3:
6667  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6668  else {
6669  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 350, __pyx_L3_error)
6670  }
6671  CYTHON_FALLTHROUGH;
6672  case 4:
6673  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6674  else {
6675  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 350, __pyx_L3_error)
6676  }
6677  CYTHON_FALLTHROUGH;
6678  case 5:
6679  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6680  else {
6681  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 350, __pyx_L3_error)
6682  }
6683  }
6684  if (unlikely(kw_args > 0)) {
6685  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "basm_NR_solve") < 0)) __PYX_ERR(0, 350, __pyx_L3_error)
6686  }
6687  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6688  goto __pyx_L5_argtuple_error;
6689  } else {
6690  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6691  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6692  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6693  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6694  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6695  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6696  }
6697  __pyx_v_A = values[0];
6698  __pyx_v_w = values[1];
6699  __pyx_v_basmFactor = values[2];
6700  __pyx_v_node_order = values[3];
6701  __pyx_v_R = values[4];
6702  __pyx_v_dX = values[5];
6703  }
6704  goto __pyx_L4_argument_unpacking_done;
6705  __pyx_L5_argtuple_error:;
6706  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error)
6707  __pyx_L3_error:;
6708  __Pyx_AddTraceback("csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6709  __Pyx_RefNannyFinishContext();
6710  return NULL;
6711  __pyx_L4_argument_unpacking_done:;
6712  __pyx_r = __pyx_pf_10csmoothers_18basm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_basmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6713 
6714  /* function exit code */
6715  __Pyx_RefNannyFinishContext();
6716  return __pyx_r;
6717 }
6718 
6719 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6720  PyObject *__pyx_r = NULL;
6721  __Pyx_RefNannyDeclarations
6722  PyObject *__pyx_t_1 = NULL;
6723  double __pyx_t_2;
6724  PyObject *__pyx_t_3 = NULL;
6725  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6726  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6727  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6728  int __pyx_lineno = 0;
6729  const char *__pyx_filename = NULL;
6730  int __pyx_clineno = 0;
6731  __Pyx_RefNannySetupContext("basm_NR_solve", 0);
6732 
6733  /* "csmoothers.pyx":362
6734  * dX :
6735  * """
6736  * smootherWrappers_basm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6737  * w,
6738  * basmFactor._cBASMFactor,
6739  */
6740  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
6741  __Pyx_GOTREF(__pyx_t_1);
6742  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 362, __pyx_L1_error)
6743 
6744  /* "csmoothers.pyx":363
6745  * """
6746  * smootherWrappers_basm_NR_solve(A._cSparseMatrix,
6747  * w, # <<<<<<<<<<<<<<
6748  * basmFactor._cBASMFactor,
6749  * node_order,
6750  */
6751  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
6752 
6753  /* "csmoothers.pyx":364
6754  * smootherWrappers_basm_NR_solve(A._cSparseMatrix,
6755  * w,
6756  * basmFactor._cBASMFactor, # <<<<<<<<<<<<<<
6757  * node_order,
6758  * R,
6759  */
6760  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error)
6761  __Pyx_GOTREF(__pyx_t_3);
6762  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 364, __pyx_L1_error)
6763 
6764  /* "csmoothers.pyx":365
6765  * w,
6766  * basmFactor._cBASMFactor,
6767  * node_order, # <<<<<<<<<<<<<<
6768  * R,
6769  * dX)
6770  */
6771  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 365, __pyx_L1_error)
6772 
6773  /* "csmoothers.pyx":366
6774  * basmFactor._cBASMFactor,
6775  * node_order,
6776  * R, # <<<<<<<<<<<<<<
6777  * dX)
6778  *
6779  */
6780  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 366, __pyx_L1_error)
6781 
6782  /* "csmoothers.pyx":367
6783  * node_order,
6784  * R,
6785  * dX) # <<<<<<<<<<<<<<
6786  *
6787  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm,
6788  */
6789  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 367, __pyx_L1_error)
6790 
6791  /* "csmoothers.pyx":362
6792  * dX :
6793  * """
6794  * smootherWrappers_basm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6795  * w,
6796  * basmFactor._cBASMFactor,
6797  */
6798  __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6799  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6800  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6801  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6802  __pyx_t_4.memview = NULL;
6803  __pyx_t_4.data = NULL;
6804  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6805  __pyx_t_5.memview = NULL;
6806  __pyx_t_5.data = NULL;
6807  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6808  __pyx_t_6.memview = NULL;
6809  __pyx_t_6.data = NULL;
6810 
6811  /* "csmoothers.pyx":350
6812  *
6813  *
6814  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6815  * """
6816  *
6817  */
6818 
6819  /* function exit code */
6820  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6821  goto __pyx_L0;
6822  __pyx_L1_error:;
6823  __Pyx_XDECREF(__pyx_t_1);
6824  __Pyx_XDECREF(__pyx_t_3);
6825  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6826  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6827  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6828  __Pyx_AddTraceback("csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6829  __pyx_r = NULL;
6830  __pyx_L0:;
6831  __Pyx_XGIVEREF(__pyx_r);
6832  __Pyx_RefNannyFinishContext();
6833  return __pyx_r;
6834 }
6835 
6836 /* "csmoothers.pyx":369
6837  * dX)
6838  *
6839  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6840  * double w,
6841  * cBASMFactor basmFactor,
6842  */
6843 
6844 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6845  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6846  __Pyx_RefNannyDeclarations
6847  PyObject *__pyx_t_1 = NULL;
6848  int __pyx_t_2;
6849  Py_ssize_t __pyx_t_3;
6850  Py_ssize_t __pyx_t_4;
6851  Py_ssize_t __pyx_t_5;
6852  int __pyx_lineno = 0;
6853  const char *__pyx_filename = NULL;
6854  int __pyx_clineno = 0;
6855  __Pyx_RefNannySetupContext("smootherWrappers_basm_NR_solve", 0);
6856 
6857  /* "csmoothers.pyx":376
6858  * DDATA dX):
6859  * cdef SuperMatrix AS
6860  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
6861  * AS.Dtype = superluWrappers._SLU_D
6862  * AS.Mtype = superluWrappers._SLU_GE
6863  */
6864  __pyx_v_AS.Stype = SLU_NR;
6865 
6866  /* "csmoothers.pyx":377
6867  * cdef SuperMatrix AS
6868  * AS.Stype = superluWrappers._SLU_NR
6869  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6870  * AS.Mtype = superluWrappers._SLU_GE
6871  * AS.nrow = sm.nr
6872  */
6873  __pyx_v_AS.Dtype = SLU_D;
6874 
6875  /* "csmoothers.pyx":378
6876  * AS.Stype = superluWrappers._SLU_NR
6877  * AS.Dtype = superluWrappers._SLU_D
6878  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6879  * AS.nrow = sm.nr
6880  * AS.ncol = sm.nc
6881  */
6882  __pyx_v_AS.Mtype = SLU_GE;
6883 
6884  /* "csmoothers.pyx":379
6885  * AS.Dtype = superluWrappers._SLU_D
6886  * AS.Mtype = superluWrappers._SLU_GE
6887  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6888  * AS.ncol = sm.nc
6889  * AS.Store = &sm.A
6890  */
6891  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
6892  __Pyx_GOTREF(__pyx_t_1);
6893  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error)
6894  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6895  __pyx_v_AS.nrow = __pyx_t_2;
6896 
6897  /* "csmoothers.pyx":380
6898  * AS.Mtype = superluWrappers._SLU_GE
6899  * AS.nrow = sm.nr
6900  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6901  * AS.Store = &sm.A
6902  * cbasm_NR_solve(basmFactor.bs,
6903  */
6904  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
6905  __Pyx_GOTREF(__pyx_t_1);
6906  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
6907  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6908  __pyx_v_AS.ncol = __pyx_t_2;
6909 
6910  /* "csmoothers.pyx":381
6911  * AS.nrow = sm.nr
6912  * AS.ncol = sm.nc
6913  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6914  * cbasm_NR_solve(basmFactor.bs,
6915  * basmFactor.N,
6916  */
6917  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6918 
6919  /* "csmoothers.pyx":389
6920  * basmFactor.subdomain_dim,
6921  * basmFactor.l2g_L,
6922  * &R[0], # <<<<<<<<<<<<<<
6923  * basmFactor.subdomain_R,
6924  * &node_order[0],
6925  */
6926  __pyx_t_3 = 0;
6927  __pyx_t_2 = -1;
6928  if (__pyx_t_3 < 0) {
6929  __pyx_t_3 += __pyx_v_R.shape[0];
6930  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6931  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6932  if (unlikely(__pyx_t_2 != -1)) {
6933  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6934  __PYX_ERR(0, 389, __pyx_L1_error)
6935  }
6936 
6937  /* "csmoothers.pyx":391
6938  * &R[0],
6939  * basmFactor.subdomain_R,
6940  * &node_order[0], # <<<<<<<<<<<<<<
6941  * basmFactor.subdomain_dX,
6942  * &dX[0],
6943  */
6944  __pyx_t_4 = 0;
6945  __pyx_t_2 = -1;
6946  if (__pyx_t_4 < 0) {
6947  __pyx_t_4 += __pyx_v_node_order.shape[0];
6948  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6949  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6950  if (unlikely(__pyx_t_2 != -1)) {
6951  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6952  __PYX_ERR(0, 391, __pyx_L1_error)
6953  }
6954 
6955  /* "csmoothers.pyx":393
6956  * &node_order[0],
6957  * basmFactor.subdomain_dX,
6958  * &dX[0], # <<<<<<<<<<<<<<
6959  * basmFactor.subdomain_pivots,
6960  * basmFactor.subdomain_col_pivots)
6961  */
6962  __pyx_t_5 = 0;
6963  __pyx_t_2 = -1;
6964  if (__pyx_t_5 < 0) {
6965  __pyx_t_5 += __pyx_v_dX.shape[0];
6966  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6967  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6968  if (unlikely(__pyx_t_2 != -1)) {
6969  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6970  __PYX_ERR(0, 393, __pyx_L1_error)
6971  }
6972 
6973  /* "csmoothers.pyx":382
6974  * AS.ncol = sm.nc
6975  * AS.Store = &sm.A
6976  * cbasm_NR_solve(basmFactor.bs, # <<<<<<<<<<<<<<
6977  * basmFactor.N,
6978  * &AS,
6979  */
6980  basm_NR_solve(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_w, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_basmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_basmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6981 
6982  /* "csmoothers.pyx":369
6983  * dX)
6984  *
6985  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6986  * double w,
6987  * cBASMFactor basmFactor,
6988  */
6989 
6990  /* function exit code */
6991  goto __pyx_L0;
6992  __pyx_L1_error:;
6993  __Pyx_XDECREF(__pyx_t_1);
6994  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6995  __pyx_L0:;
6996  __Pyx_RefNannyFinishContext();
6997 }
6998 
6999 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":742
7000  * ctypedef npy_cdouble complex_t
7001  *
7002  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7003  * return PyArray_MultiIterNew(1, <void*>a)
7004  *
7005  */
7006 
7007 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7008  PyObject *__pyx_r = NULL;
7009  __Pyx_RefNannyDeclarations
7010  PyObject *__pyx_t_1 = NULL;
7011  int __pyx_lineno = 0;
7012  const char *__pyx_filename = NULL;
7013  int __pyx_clineno = 0;
7014  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
7015 
7016  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":743
7017  *
7018  * cdef inline object PyArray_MultiIterNew1(a):
7019  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
7020  *
7021  * cdef inline object PyArray_MultiIterNew2(a, b):
7022  */
7023  __Pyx_XDECREF(__pyx_r);
7024  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 743, __pyx_L1_error)
7025  __Pyx_GOTREF(__pyx_t_1);
7026  __pyx_r = __pyx_t_1;
7027  __pyx_t_1 = 0;
7028  goto __pyx_L0;
7029 
7030  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":742
7031  * ctypedef npy_cdouble complex_t
7032  *
7033  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7034  * return PyArray_MultiIterNew(1, <void*>a)
7035  *
7036  */
7037 
7038  /* function exit code */
7039  __pyx_L1_error:;
7040  __Pyx_XDECREF(__pyx_t_1);
7041  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7042  __pyx_r = 0;
7043  __pyx_L0:;
7044  __Pyx_XGIVEREF(__pyx_r);
7045  __Pyx_RefNannyFinishContext();
7046  return __pyx_r;
7047 }
7048 
7049 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":745
7050  * return PyArray_MultiIterNew(1, <void*>a)
7051  *
7052  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7053  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7054  *
7055  */
7056 
7057 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7058  PyObject *__pyx_r = NULL;
7059  __Pyx_RefNannyDeclarations
7060  PyObject *__pyx_t_1 = NULL;
7061  int __pyx_lineno = 0;
7062  const char *__pyx_filename = NULL;
7063  int __pyx_clineno = 0;
7064  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
7065 
7066  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":746
7067  *
7068  * cdef inline object PyArray_MultiIterNew2(a, b):
7069  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
7070  *
7071  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7072  */
7073  __Pyx_XDECREF(__pyx_r);
7074  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 746, __pyx_L1_error)
7075  __Pyx_GOTREF(__pyx_t_1);
7076  __pyx_r = __pyx_t_1;
7077  __pyx_t_1 = 0;
7078  goto __pyx_L0;
7079 
7080  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":745
7081  * return PyArray_MultiIterNew(1, <void*>a)
7082  *
7083  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7084  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7085  *
7086  */
7087 
7088  /* function exit code */
7089  __pyx_L1_error:;
7090  __Pyx_XDECREF(__pyx_t_1);
7091  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7092  __pyx_r = 0;
7093  __pyx_L0:;
7094  __Pyx_XGIVEREF(__pyx_r);
7095  __Pyx_RefNannyFinishContext();
7096  return __pyx_r;
7097 }
7098 
7099 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":748
7100  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7101  *
7102  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7103  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7104  *
7105  */
7106 
7107 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7108  PyObject *__pyx_r = NULL;
7109  __Pyx_RefNannyDeclarations
7110  PyObject *__pyx_t_1 = NULL;
7111  int __pyx_lineno = 0;
7112  const char *__pyx_filename = NULL;
7113  int __pyx_clineno = 0;
7114  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
7115 
7116  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":749
7117  *
7118  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7119  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
7120  *
7121  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7122  */
7123  __Pyx_XDECREF(__pyx_r);
7124  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 749, __pyx_L1_error)
7125  __Pyx_GOTREF(__pyx_t_1);
7126  __pyx_r = __pyx_t_1;
7127  __pyx_t_1 = 0;
7128  goto __pyx_L0;
7129 
7130  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":748
7131  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7132  *
7133  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7134  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7135  *
7136  */
7137 
7138  /* function exit code */
7139  __pyx_L1_error:;
7140  __Pyx_XDECREF(__pyx_t_1);
7141  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7142  __pyx_r = 0;
7143  __pyx_L0:;
7144  __Pyx_XGIVEREF(__pyx_r);
7145  __Pyx_RefNannyFinishContext();
7146  return __pyx_r;
7147 }
7148 
7149 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":751
7150  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7151  *
7152  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7153  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7154  *
7155  */
7156 
7157 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7158  PyObject *__pyx_r = NULL;
7159  __Pyx_RefNannyDeclarations
7160  PyObject *__pyx_t_1 = NULL;
7161  int __pyx_lineno = 0;
7162  const char *__pyx_filename = NULL;
7163  int __pyx_clineno = 0;
7164  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
7165 
7166  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":752
7167  *
7168  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7169  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
7170  *
7171  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7172  */
7173  __Pyx_XDECREF(__pyx_r);
7174  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 752, __pyx_L1_error)
7175  __Pyx_GOTREF(__pyx_t_1);
7176  __pyx_r = __pyx_t_1;
7177  __pyx_t_1 = 0;
7178  goto __pyx_L0;
7179 
7180  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":751
7181  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7182  *
7183  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7184  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7185  *
7186  */
7187 
7188  /* function exit code */
7189  __pyx_L1_error:;
7190  __Pyx_XDECREF(__pyx_t_1);
7191  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7192  __pyx_r = 0;
7193  __pyx_L0:;
7194  __Pyx_XGIVEREF(__pyx_r);
7195  __Pyx_RefNannyFinishContext();
7196  return __pyx_r;
7197 }
7198 
7199 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":754
7200  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7201  *
7202  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7203  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7204  *
7205  */
7206 
7207 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7208  PyObject *__pyx_r = NULL;
7209  __Pyx_RefNannyDeclarations
7210  PyObject *__pyx_t_1 = NULL;
7211  int __pyx_lineno = 0;
7212  const char *__pyx_filename = NULL;
7213  int __pyx_clineno = 0;
7214  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7215 
7216  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":755
7217  *
7218  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7219  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7220  *
7221  * cdef inline tuple PyDataType_SHAPE(dtype d):
7222  */
7223  __Pyx_XDECREF(__pyx_r);
7224  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 755, __pyx_L1_error)
7225  __Pyx_GOTREF(__pyx_t_1);
7226  __pyx_r = __pyx_t_1;
7227  __pyx_t_1 = 0;
7228  goto __pyx_L0;
7229 
7230  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":754
7231  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7232  *
7233  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7234  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7235  *
7236  */
7237 
7238  /* function exit code */
7239  __pyx_L1_error:;
7240  __Pyx_XDECREF(__pyx_t_1);
7241  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7242  __pyx_r = 0;
7243  __pyx_L0:;
7244  __Pyx_XGIVEREF(__pyx_r);
7245  __Pyx_RefNannyFinishContext();
7246  return __pyx_r;
7247 }
7248 
7249 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":757
7250  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7251  *
7252  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7253  * if PyDataType_HASSUBARRAY(d):
7254  * return <tuple>d.subarray.shape
7255  */
7256 
7257 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7258  PyObject *__pyx_r = NULL;
7259  __Pyx_RefNannyDeclarations
7260  int __pyx_t_1;
7261  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7262 
7263  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":758
7264  *
7265  * cdef inline tuple PyDataType_SHAPE(dtype d):
7266  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7267  * return <tuple>d.subarray.shape
7268  * else:
7269  */
7270  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7271  if (__pyx_t_1) {
7272 
7273  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":759
7274  * cdef inline tuple PyDataType_SHAPE(dtype d):
7275  * if PyDataType_HASSUBARRAY(d):
7276  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7277  * else:
7278  * return ()
7279  */
7280  __Pyx_XDECREF(__pyx_r);
7281  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7282  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7283  goto __pyx_L0;
7284 
7285  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":758
7286  *
7287  * cdef inline tuple PyDataType_SHAPE(dtype d):
7288  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7289  * return <tuple>d.subarray.shape
7290  * else:
7291  */
7292  }
7293 
7294  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":761
7295  * return <tuple>d.subarray.shape
7296  * else:
7297  * return () # <<<<<<<<<<<<<<
7298  *
7299  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
7300  */
7301  /*else*/ {
7302  __Pyx_XDECREF(__pyx_r);
7303  __Pyx_INCREF(__pyx_empty_tuple);
7304  __pyx_r = __pyx_empty_tuple;
7305  goto __pyx_L0;
7306  }
7307 
7308  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":757
7309  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7310  *
7311  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7312  * if PyDataType_HASSUBARRAY(d):
7313  * return <tuple>d.subarray.shape
7314  */
7315 
7316  /* function exit code */
7317  __pyx_L0:;
7318  __Pyx_XGIVEREF(__pyx_r);
7319  __Pyx_RefNannyFinishContext();
7320  return __pyx_r;
7321 }
7322 
7323 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":763
7324  * return ()
7325  *
7326  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7327  * # Recursive utility function used in __getbuffer__ to get format
7328  * # string. The new location in the format string is returned.
7329  */
7330 
7331 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
7332  PyArray_Descr *__pyx_v_child = 0;
7333  int __pyx_v_endian_detector;
7334  int __pyx_v_little_endian;
7335  PyObject *__pyx_v_fields = 0;
7336  PyObject *__pyx_v_childname = NULL;
7337  PyObject *__pyx_v_new_offset = NULL;
7338  PyObject *__pyx_v_t = NULL;
7339  char *__pyx_r;
7340  __Pyx_RefNannyDeclarations
7341  PyObject *__pyx_t_1 = NULL;
7342  Py_ssize_t __pyx_t_2;
7343  PyObject *__pyx_t_3 = NULL;
7344  PyObject *__pyx_t_4 = NULL;
7345  int __pyx_t_5;
7346  int __pyx_t_6;
7347  int __pyx_t_7;
7348  long __pyx_t_8;
7349  char *__pyx_t_9;
7350  int __pyx_lineno = 0;
7351  const char *__pyx_filename = NULL;
7352  int __pyx_clineno = 0;
7353  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
7354 
7355  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":768
7356  *
7357  * cdef dtype child
7358  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
7359  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
7360  * cdef tuple fields
7361  */
7362  __pyx_v_endian_detector = 1;
7363 
7364  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":769
7365  * cdef dtype child
7366  * cdef int endian_detector = 1
7367  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
7368  * cdef tuple fields
7369  *
7370  */
7371  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
7372 
7373  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":772
7374  * cdef tuple fields
7375  *
7376  * for childname in descr.names: # <<<<<<<<<<<<<<
7377  * fields = descr.fields[childname]
7378  * child, new_offset = fields
7379  */
7380  if (unlikely(__pyx_v_descr->names == Py_None)) {
7381  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
7382  __PYX_ERR(2, 772, __pyx_L1_error)
7383  }
7384  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7385  for (;;) {
7386  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
7387  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7388  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 772, __pyx_L1_error)
7389  #else
7390  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 772, __pyx_L1_error)
7391  __Pyx_GOTREF(__pyx_t_3);
7392  #endif
7393  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
7394  __pyx_t_3 = 0;
7395 
7396  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":773
7397  *
7398  * for childname in descr.names:
7399  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
7400  * child, new_offset = fields
7401  *
7402  */
7403  if (unlikely(__pyx_v_descr->fields == Py_None)) {
7404  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7405  __PYX_ERR(2, 773, __pyx_L1_error)
7406  }
7407  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 773, __pyx_L1_error)
7408  __Pyx_GOTREF(__pyx_t_3);
7409  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 773, __pyx_L1_error)
7410  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
7411  __pyx_t_3 = 0;
7412 
7413  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":774
7414  * for childname in descr.names:
7415  * fields = descr.fields[childname]
7416  * child, new_offset = fields # <<<<<<<<<<<<<<
7417  *
7418  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7419  */
7420  if (likely(__pyx_v_fields != Py_None)) {
7421  PyObject* sequence = __pyx_v_fields;
7422  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7423  if (unlikely(size != 2)) {
7424  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7425  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7426  __PYX_ERR(2, 774, __pyx_L1_error)
7427  }
7428  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7429  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7430  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7431  __Pyx_INCREF(__pyx_t_3);
7432  __Pyx_INCREF(__pyx_t_4);
7433  #else
7434  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 774, __pyx_L1_error)
7435  __Pyx_GOTREF(__pyx_t_3);
7436  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 774, __pyx_L1_error)
7437  __Pyx_GOTREF(__pyx_t_4);
7438  #endif
7439  } else {
7440  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 774, __pyx_L1_error)
7441  }
7442  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 774, __pyx_L1_error)
7443  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
7444  __pyx_t_3 = 0;
7445  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
7446  __pyx_t_4 = 0;
7447 
7448  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":776
7449  * child, new_offset = fields
7450  *
7451  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7452  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7453  *
7454  */
7455  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 776, __pyx_L1_error)
7456  __Pyx_GOTREF(__pyx_t_4);
7457  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 776, __pyx_L1_error)
7458  __Pyx_GOTREF(__pyx_t_3);
7459  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7460  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 776, __pyx_L1_error)
7461  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7462  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
7463  if (unlikely(__pyx_t_6)) {
7464 
7465  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":777
7466  *
7467  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7468  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
7469  *
7470  * if ((child.byteorder == c'>' and little_endian) or
7471  */
7472  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error)
7473  __Pyx_GOTREF(__pyx_t_3);
7474  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7475  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7476  __PYX_ERR(2, 777, __pyx_L1_error)
7477 
7478  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":776
7479  * child, new_offset = fields
7480  *
7481  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7482  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7483  *
7484  */
7485  }
7486 
7487  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":779
7488  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7489  *
7490  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7491  * (child.byteorder == c'<' and not little_endian)):
7492  * raise ValueError(u"Non-native byte order not supported")
7493  */
7494  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
7495  if (!__pyx_t_7) {
7496  goto __pyx_L8_next_or;
7497  } else {
7498  }
7499  __pyx_t_7 = (__pyx_v_little_endian != 0);
7500  if (!__pyx_t_7) {
7501  } else {
7502  __pyx_t_6 = __pyx_t_7;
7503  goto __pyx_L7_bool_binop_done;
7504  }
7505  __pyx_L8_next_or:;
7506 
7507  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":780
7508  *
7509  * if ((child.byteorder == c'>' and little_endian) or
7510  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
7511  * raise ValueError(u"Non-native byte order not supported")
7512  * # One could encode it in the format string and have Cython
7513  */
7514  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
7515  if (__pyx_t_7) {
7516  } else {
7517  __pyx_t_6 = __pyx_t_7;
7518  goto __pyx_L7_bool_binop_done;
7519  }
7520  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7521  __pyx_t_6 = __pyx_t_7;
7522  __pyx_L7_bool_binop_done:;
7523 
7524  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":779
7525  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7526  *
7527  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7528  * (child.byteorder == c'<' and not little_endian)):
7529  * raise ValueError(u"Non-native byte order not supported")
7530  */
7531  if (unlikely(__pyx_t_6)) {
7532 
7533  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":781
7534  * if ((child.byteorder == c'>' and little_endian) or
7535  * (child.byteorder == c'<' and not little_endian)):
7536  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7537  * # One could encode it in the format string and have Cython
7538  * # complain instead, BUT: < and > in format strings also imply
7539  */
7540  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 781, __pyx_L1_error)
7541  __Pyx_GOTREF(__pyx_t_3);
7542  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7543  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7544  __PYX_ERR(2, 781, __pyx_L1_error)
7545 
7546  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":779
7547  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7548  *
7549  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7550  * (child.byteorder == c'<' and not little_endian)):
7551  * raise ValueError(u"Non-native byte order not supported")
7552  */
7553  }
7554 
7555  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":791
7556  *
7557  * # Output padding bytes
7558  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
7559  * f[0] = 120 # "x"; pad byte
7560  * f += 1
7561  */
7562  while (1) {
7563  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 791, __pyx_L1_error)
7564  __Pyx_GOTREF(__pyx_t_3);
7565  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 791, __pyx_L1_error)
7566  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7567  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 791, __pyx_L1_error)
7568  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7569  if (!__pyx_t_6) break;
7570 
7571  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":792
7572  * # Output padding bytes
7573  * while offset[0] < new_offset:
7574  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
7575  * f += 1
7576  * offset[0] += 1
7577  */
7578  (__pyx_v_f[0]) = 0x78;
7579 
7580  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":793
7581  * while offset[0] < new_offset:
7582  * f[0] = 120 # "x"; pad byte
7583  * f += 1 # <<<<<<<<<<<<<<
7584  * offset[0] += 1
7585  *
7586  */
7587  __pyx_v_f = (__pyx_v_f + 1);
7588 
7589  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":794
7590  * f[0] = 120 # "x"; pad byte
7591  * f += 1
7592  * offset[0] += 1 # <<<<<<<<<<<<<<
7593  *
7594  * offset[0] += child.itemsize
7595  */
7596  __pyx_t_8 = 0;
7597  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7598  }
7599 
7600  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":796
7601  * offset[0] += 1
7602  *
7603  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
7604  *
7605  * if not PyDataType_HASFIELDS(child):
7606  */
7607  __pyx_t_8 = 0;
7608  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7609 
7610  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":798
7611  * offset[0] += child.itemsize
7612  *
7613  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7614  * t = child.type_num
7615  * if end - f < 5:
7616  */
7617  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7618  if (__pyx_t_6) {
7619 
7620  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":799
7621  *
7622  * if not PyDataType_HASFIELDS(child):
7623  * t = child.type_num # <<<<<<<<<<<<<<
7624  * if end - f < 5:
7625  * raise RuntimeError(u"Format string allocated too short.")
7626  */
7627  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 799, __pyx_L1_error)
7628  __Pyx_GOTREF(__pyx_t_4);
7629  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7630  __pyx_t_4 = 0;
7631 
7632  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":800
7633  * if not PyDataType_HASFIELDS(child):
7634  * t = child.type_num
7635  * if end - f < 5: # <<<<<<<<<<<<<<
7636  * raise RuntimeError(u"Format string allocated too short.")
7637  *
7638  */
7639  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7640  if (unlikely(__pyx_t_6)) {
7641 
7642  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":801
7643  * t = child.type_num
7644  * if end - f < 5:
7645  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
7646  *
7647  * # Until ticket #99 is fixed, use integers to avoid warnings
7648  */
7649  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 801, __pyx_L1_error)
7650  __Pyx_GOTREF(__pyx_t_4);
7651  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7652  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7653  __PYX_ERR(2, 801, __pyx_L1_error)
7654 
7655  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":800
7656  * if not PyDataType_HASFIELDS(child):
7657  * t = child.type_num
7658  * if end - f < 5: # <<<<<<<<<<<<<<
7659  * raise RuntimeError(u"Format string allocated too short.")
7660  *
7661  */
7662  }
7663 
7664  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":804
7665  *
7666  * # Until ticket #99 is fixed, use integers to avoid warnings
7667  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
7668  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7669  * elif t == NPY_SHORT: f[0] = 104 #"h"
7670  */
7671  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 804, __pyx_L1_error)
7672  __Pyx_GOTREF(__pyx_t_4);
7673  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 804, __pyx_L1_error)
7674  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7675  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 804, __pyx_L1_error)
7676  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7677  if (__pyx_t_6) {
7678  (__pyx_v_f[0]) = 98;
7679  goto __pyx_L15;
7680  }
7681 
7682  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":805
7683  * # Until ticket #99 is fixed, use integers to avoid warnings
7684  * if t == NPY_BYTE: f[0] = 98 #"b"
7685  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
7686  * elif t == NPY_SHORT: f[0] = 104 #"h"
7687  * elif t == NPY_USHORT: f[0] = 72 #"H"
7688  */
7689  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 805, __pyx_L1_error)
7690  __Pyx_GOTREF(__pyx_t_3);
7691  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 805, __pyx_L1_error)
7692  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7693  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 805, __pyx_L1_error)
7694  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7695  if (__pyx_t_6) {
7696  (__pyx_v_f[0]) = 66;
7697  goto __pyx_L15;
7698  }
7699 
7700  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":806
7701  * if t == NPY_BYTE: f[0] = 98 #"b"
7702  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7703  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
7704  * elif t == NPY_USHORT: f[0] = 72 #"H"
7705  * elif t == NPY_INT: f[0] = 105 #"i"
7706  */
7707  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 806, __pyx_L1_error)
7708  __Pyx_GOTREF(__pyx_t_4);
7709  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 806, __pyx_L1_error)
7710  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7711  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 806, __pyx_L1_error)
7712  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7713  if (__pyx_t_6) {
7714  (__pyx_v_f[0]) = 0x68;
7715  goto __pyx_L15;
7716  }
7717 
7718  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":807
7719  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7720  * elif t == NPY_SHORT: f[0] = 104 #"h"
7721  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
7722  * elif t == NPY_INT: f[0] = 105 #"i"
7723  * elif t == NPY_UINT: f[0] = 73 #"I"
7724  */
7725  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 807, __pyx_L1_error)
7726  __Pyx_GOTREF(__pyx_t_3);
7727  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 807, __pyx_L1_error)
7728  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7729  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 807, __pyx_L1_error)
7730  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7731  if (__pyx_t_6) {
7732  (__pyx_v_f[0]) = 72;
7733  goto __pyx_L15;
7734  }
7735 
7736  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":808
7737  * elif t == NPY_SHORT: f[0] = 104 #"h"
7738  * elif t == NPY_USHORT: f[0] = 72 #"H"
7739  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
7740  * elif t == NPY_UINT: f[0] = 73 #"I"
7741  * elif t == NPY_LONG: f[0] = 108 #"l"
7742  */
7743  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 808, __pyx_L1_error)
7744  __Pyx_GOTREF(__pyx_t_4);
7745  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 808, __pyx_L1_error)
7746  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7747  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 808, __pyx_L1_error)
7748  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7749  if (__pyx_t_6) {
7750  (__pyx_v_f[0]) = 0x69;
7751  goto __pyx_L15;
7752  }
7753 
7754  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":809
7755  * elif t == NPY_USHORT: f[0] = 72 #"H"
7756  * elif t == NPY_INT: f[0] = 105 #"i"
7757  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
7758  * elif t == NPY_LONG: f[0] = 108 #"l"
7759  * elif t == NPY_ULONG: f[0] = 76 #"L"
7760  */
7761  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 809, __pyx_L1_error)
7762  __Pyx_GOTREF(__pyx_t_3);
7763  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 809, __pyx_L1_error)
7764  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7765  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 809, __pyx_L1_error)
7766  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7767  if (__pyx_t_6) {
7768  (__pyx_v_f[0]) = 73;
7769  goto __pyx_L15;
7770  }
7771 
7772  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":810
7773  * elif t == NPY_INT: f[0] = 105 #"i"
7774  * elif t == NPY_UINT: f[0] = 73 #"I"
7775  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
7776  * elif t == NPY_ULONG: f[0] = 76 #"L"
7777  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7778  */
7779  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 810, __pyx_L1_error)
7780  __Pyx_GOTREF(__pyx_t_4);
7781  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 810, __pyx_L1_error)
7782  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7783  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 810, __pyx_L1_error)
7784  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7785  if (__pyx_t_6) {
7786  (__pyx_v_f[0]) = 0x6C;
7787  goto __pyx_L15;
7788  }
7789 
7790  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":811
7791  * elif t == NPY_UINT: f[0] = 73 #"I"
7792  * elif t == NPY_LONG: f[0] = 108 #"l"
7793  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
7794  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7795  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7796  */
7797  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 811, __pyx_L1_error)
7798  __Pyx_GOTREF(__pyx_t_3);
7799  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 811, __pyx_L1_error)
7800  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7801  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 811, __pyx_L1_error)
7802  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7803  if (__pyx_t_6) {
7804  (__pyx_v_f[0]) = 76;
7805  goto __pyx_L15;
7806  }
7807 
7808  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":812
7809  * elif t == NPY_LONG: f[0] = 108 #"l"
7810  * elif t == NPY_ULONG: f[0] = 76 #"L"
7811  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
7812  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7813  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7814  */
7815  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 812, __pyx_L1_error)
7816  __Pyx_GOTREF(__pyx_t_4);
7817  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 812, __pyx_L1_error)
7818  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7819  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 812, __pyx_L1_error)
7820  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7821  if (__pyx_t_6) {
7822  (__pyx_v_f[0]) = 0x71;
7823  goto __pyx_L15;
7824  }
7825 
7826  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":813
7827  * elif t == NPY_ULONG: f[0] = 76 #"L"
7828  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7829  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
7830  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7831  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7832  */
7833  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error)
7834  __Pyx_GOTREF(__pyx_t_3);
7835  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error)
7836  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7837  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error)
7838  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7839  if (__pyx_t_6) {
7840  (__pyx_v_f[0]) = 81;
7841  goto __pyx_L15;
7842  }
7843 
7844  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":814
7845  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7846  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7847  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
7848  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7849  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7850  */
7851  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 814, __pyx_L1_error)
7852  __Pyx_GOTREF(__pyx_t_4);
7853  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 814, __pyx_L1_error)
7854  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7855  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 814, __pyx_L1_error)
7856  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7857  if (__pyx_t_6) {
7858  (__pyx_v_f[0]) = 0x66;
7859  goto __pyx_L15;
7860  }
7861 
7862  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":815
7863  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7864  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7865  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
7866  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7867  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7868  */
7869  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 815, __pyx_L1_error)
7870  __Pyx_GOTREF(__pyx_t_3);
7871  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 815, __pyx_L1_error)
7872  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7873  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 815, __pyx_L1_error)
7874  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7875  if (__pyx_t_6) {
7876  (__pyx_v_f[0]) = 0x64;
7877  goto __pyx_L15;
7878  }
7879 
7880  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":816
7881  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7882  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7883  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
7884  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7885  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7886  */
7887  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 816, __pyx_L1_error)
7888  __Pyx_GOTREF(__pyx_t_4);
7889  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 816, __pyx_L1_error)
7890  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7891  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 816, __pyx_L1_error)
7892  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7893  if (__pyx_t_6) {
7894  (__pyx_v_f[0]) = 0x67;
7895  goto __pyx_L15;
7896  }
7897 
7898  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":817
7899  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7900  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7901  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
7902  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7903  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7904  */
7905  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 817, __pyx_L1_error)
7906  __Pyx_GOTREF(__pyx_t_3);
7907  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 817, __pyx_L1_error)
7908  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7909  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 817, __pyx_L1_error)
7910  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7911  if (__pyx_t_6) {
7912  (__pyx_v_f[0]) = 90;
7913  (__pyx_v_f[1]) = 0x66;
7914  __pyx_v_f = (__pyx_v_f + 1);
7915  goto __pyx_L15;
7916  }
7917 
7918  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":818
7919  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7920  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7921  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
7922  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7923  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7924  */
7925  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 818, __pyx_L1_error)
7926  __Pyx_GOTREF(__pyx_t_4);
7927  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 818, __pyx_L1_error)
7928  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7929  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 818, __pyx_L1_error)
7930  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7931  if (__pyx_t_6) {
7932  (__pyx_v_f[0]) = 90;
7933  (__pyx_v_f[1]) = 0x64;
7934  __pyx_v_f = (__pyx_v_f + 1);
7935  goto __pyx_L15;
7936  }
7937 
7938  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":819
7939  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7940  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7941  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
7942  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7943  * else:
7944  */
7945  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 819, __pyx_L1_error)
7946  __Pyx_GOTREF(__pyx_t_3);
7947  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 819, __pyx_L1_error)
7948  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7949  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 819, __pyx_L1_error)
7950  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7951  if (__pyx_t_6) {
7952  (__pyx_v_f[0]) = 90;
7953  (__pyx_v_f[1]) = 0x67;
7954  __pyx_v_f = (__pyx_v_f + 1);
7955  goto __pyx_L15;
7956  }
7957 
7958  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":820
7959  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7960  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7961  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
7962  * else:
7963  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7964  */
7965  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 820, __pyx_L1_error)
7966  __Pyx_GOTREF(__pyx_t_4);
7967  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 820, __pyx_L1_error)
7968  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7969  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 820, __pyx_L1_error)
7970  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7971  if (likely(__pyx_t_6)) {
7972  (__pyx_v_f[0]) = 79;
7973  goto __pyx_L15;
7974  }
7975 
7976  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":822
7977  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7978  * else:
7979  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7980  * f += 1
7981  * else:
7982  */
7983  /*else*/ {
7984  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 822, __pyx_L1_error)
7985  __Pyx_GOTREF(__pyx_t_3);
7986  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 822, __pyx_L1_error)
7987  __Pyx_GOTREF(__pyx_t_4);
7988  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7989  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7990  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7991  __PYX_ERR(2, 822, __pyx_L1_error)
7992  }
7993  __pyx_L15:;
7994 
7995  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":823
7996  * else:
7997  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7998  * f += 1 # <<<<<<<<<<<<<<
7999  * else:
8000  * # Cython ignores struct boundary information ("T{...}"),
8001  */
8002  __pyx_v_f = (__pyx_v_f + 1);
8003 
8004  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":798
8005  * offset[0] += child.itemsize
8006  *
8007  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
8008  * t = child.type_num
8009  * if end - f < 5:
8010  */
8011  goto __pyx_L13;
8012  }
8013 
8014  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":827
8015  * # Cython ignores struct boundary information ("T{...}"),
8016  * # so don't output it
8017  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
8018  * return f
8019  *
8020  */
8021  /*else*/ {
8022  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 827, __pyx_L1_error)
8023  __pyx_v_f = __pyx_t_9;
8024  }
8025  __pyx_L13:;
8026 
8027  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":772
8028  * cdef tuple fields
8029  *
8030  * for childname in descr.names: # <<<<<<<<<<<<<<
8031  * fields = descr.fields[childname]
8032  * child, new_offset = fields
8033  */
8034  }
8035  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8036 
8037  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":828
8038  * # so don't output it
8039  * f = _util_dtypestring(child, f, end, offset)
8040  * return f # <<<<<<<<<<<<<<
8041  *
8042  *
8043  */
8044  __pyx_r = __pyx_v_f;
8045  goto __pyx_L0;
8046 
8047  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":763
8048  * return ()
8049  *
8050  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
8051  * # Recursive utility function used in __getbuffer__ to get format
8052  * # string. The new location in the format string is returned.
8053  */
8054 
8055  /* function exit code */
8056  __pyx_L1_error:;
8057  __Pyx_XDECREF(__pyx_t_1);
8058  __Pyx_XDECREF(__pyx_t_3);
8059  __Pyx_XDECREF(__pyx_t_4);
8060  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
8061  __pyx_r = NULL;
8062  __pyx_L0:;
8063  __Pyx_XDECREF((PyObject *)__pyx_v_child);
8064  __Pyx_XDECREF(__pyx_v_fields);
8065  __Pyx_XDECREF(__pyx_v_childname);
8066  __Pyx_XDECREF(__pyx_v_new_offset);
8067  __Pyx_XDECREF(__pyx_v_t);
8068  __Pyx_RefNannyFinishContext();
8069  return __pyx_r;
8070 }
8071 
8072 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":943
8073  * int _import_umath() except -1
8074  *
8075  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
8076  * Py_INCREF(base) # important to do this before stealing the reference below!
8077  * PyArray_SetBaseObject(arr, base)
8078  */
8079 
8080 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
8081  __Pyx_RefNannyDeclarations
8082  __Pyx_RefNannySetupContext("set_array_base", 0);
8083 
8084  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":944
8085  *
8086  * cdef inline void set_array_base(ndarray arr, object base):
8087  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
8088  * PyArray_SetBaseObject(arr, base)
8089  *
8090  */
8091  Py_INCREF(__pyx_v_base);
8092 
8093  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":945
8094  * cdef inline void set_array_base(ndarray arr, object base):
8095  * Py_INCREF(base) # important to do this before stealing the reference below!
8096  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
8097  *
8098  * cdef inline object get_array_base(ndarray arr):
8099  */
8100  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
8101 
8102  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":943
8103  * int _import_umath() except -1
8104  *
8105  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
8106  * Py_INCREF(base) # important to do this before stealing the reference below!
8107  * PyArray_SetBaseObject(arr, base)
8108  */
8109 
8110  /* function exit code */
8111  __Pyx_RefNannyFinishContext();
8112 }
8113 
8114 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":947
8115  * PyArray_SetBaseObject(arr, base)
8116  *
8117  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8118  * base = PyArray_BASE(arr)
8119  * if base is NULL:
8120  */
8121 
8122 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
8123  PyObject *__pyx_v_base;
8124  PyObject *__pyx_r = NULL;
8125  __Pyx_RefNannyDeclarations
8126  int __pyx_t_1;
8127  __Pyx_RefNannySetupContext("get_array_base", 0);
8128 
8129  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":948
8130  *
8131  * cdef inline object get_array_base(ndarray arr):
8132  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
8133  * if base is NULL:
8134  * return None
8135  */
8136  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
8137 
8138  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":949
8139  * cdef inline object get_array_base(ndarray arr):
8140  * base = PyArray_BASE(arr)
8141  * if base is NULL: # <<<<<<<<<<<<<<
8142  * return None
8143  * return <object>base
8144  */
8145  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
8146  if (__pyx_t_1) {
8147 
8148  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":950
8149  * base = PyArray_BASE(arr)
8150  * if base is NULL:
8151  * return None # <<<<<<<<<<<<<<
8152  * return <object>base
8153  *
8154  */
8155  __Pyx_XDECREF(__pyx_r);
8156  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8157  goto __pyx_L0;
8158 
8159  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":949
8160  * cdef inline object get_array_base(ndarray arr):
8161  * base = PyArray_BASE(arr)
8162  * if base is NULL: # <<<<<<<<<<<<<<
8163  * return None
8164  * return <object>base
8165  */
8166  }
8167 
8168  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":951
8169  * if base is NULL:
8170  * return None
8171  * return <object>base # <<<<<<<<<<<<<<
8172  *
8173  * # Versions of the import_* functions which are more suitable for
8174  */
8175  __Pyx_XDECREF(__pyx_r);
8176  __Pyx_INCREF(((PyObject *)__pyx_v_base));
8177  __pyx_r = ((PyObject *)__pyx_v_base);
8178  goto __pyx_L0;
8179 
8180  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":947
8181  * PyArray_SetBaseObject(arr, base)
8182  *
8183  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8184  * base = PyArray_BASE(arr)
8185  * if base is NULL:
8186  */
8187 
8188  /* function exit code */
8189  __pyx_L0:;
8190  __Pyx_XGIVEREF(__pyx_r);
8191  __Pyx_RefNannyFinishContext();
8192  return __pyx_r;
8193 }
8194 
8195 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":955
8196  * # Versions of the import_* functions which are more suitable for
8197  * # Cython code.
8198  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8199  * try:
8200  * __pyx_import_array()
8201  */
8202 
8203 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
8204  int __pyx_r;
8205  __Pyx_RefNannyDeclarations
8206  PyObject *__pyx_t_1 = NULL;
8207  PyObject *__pyx_t_2 = NULL;
8208  PyObject *__pyx_t_3 = NULL;
8209  int __pyx_t_4;
8210  PyObject *__pyx_t_5 = NULL;
8211  PyObject *__pyx_t_6 = NULL;
8212  PyObject *__pyx_t_7 = NULL;
8213  PyObject *__pyx_t_8 = NULL;
8214  int __pyx_lineno = 0;
8215  const char *__pyx_filename = NULL;
8216  int __pyx_clineno = 0;
8217  __Pyx_RefNannySetupContext("import_array", 0);
8218 
8219  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":956
8220  * # Cython code.
8221  * cdef inline int import_array() except -1:
8222  * try: # <<<<<<<<<<<<<<
8223  * __pyx_import_array()
8224  * except Exception:
8225  */
8226  {
8227  __Pyx_PyThreadState_declare
8228  __Pyx_PyThreadState_assign
8229  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8230  __Pyx_XGOTREF(__pyx_t_1);
8231  __Pyx_XGOTREF(__pyx_t_2);
8232  __Pyx_XGOTREF(__pyx_t_3);
8233  /*try:*/ {
8234 
8235  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":957
8236  * cdef inline int import_array() except -1:
8237  * try:
8238  * __pyx_import_array() # <<<<<<<<<<<<<<
8239  * except Exception:
8240  * raise ImportError("numpy.core.multiarray failed to import")
8241  */
8242  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L3_error)
8243 
8244  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":956
8245  * # Cython code.
8246  * cdef inline int import_array() except -1:
8247  * try: # <<<<<<<<<<<<<<
8248  * __pyx_import_array()
8249  * except Exception:
8250  */
8251  }
8252  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8253  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8254  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8255  goto __pyx_L8_try_end;
8256  __pyx_L3_error:;
8257 
8258  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":958
8259  * try:
8260  * __pyx_import_array()
8261  * except Exception: # <<<<<<<<<<<<<<
8262  * raise ImportError("numpy.core.multiarray failed to import")
8263  *
8264  */
8265  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8266  if (__pyx_t_4) {
8267  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8268  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 958, __pyx_L5_except_error)
8269  __Pyx_GOTREF(__pyx_t_5);
8270  __Pyx_GOTREF(__pyx_t_6);
8271  __Pyx_GOTREF(__pyx_t_7);
8272 
8273  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":959
8274  * __pyx_import_array()
8275  * except Exception:
8276  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
8277  *
8278  * cdef inline int import_umath() except -1:
8279  */
8280  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 959, __pyx_L5_except_error)
8281  __Pyx_GOTREF(__pyx_t_8);
8282  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8283  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8284  __PYX_ERR(2, 959, __pyx_L5_except_error)
8285  }
8286  goto __pyx_L5_except_error;
8287  __pyx_L5_except_error:;
8288 
8289  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":956
8290  * # Cython code.
8291  * cdef inline int import_array() except -1:
8292  * try: # <<<<<<<<<<<<<<
8293  * __pyx_import_array()
8294  * except Exception:
8295  */
8296  __Pyx_XGIVEREF(__pyx_t_1);
8297  __Pyx_XGIVEREF(__pyx_t_2);
8298  __Pyx_XGIVEREF(__pyx_t_3);
8299  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8300  goto __pyx_L1_error;
8301  __pyx_L8_try_end:;
8302  }
8303 
8304  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":955
8305  * # Versions of the import_* functions which are more suitable for
8306  * # Cython code.
8307  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8308  * try:
8309  * __pyx_import_array()
8310  */
8311 
8312  /* function exit code */
8313  __pyx_r = 0;
8314  goto __pyx_L0;
8315  __pyx_L1_error:;
8316  __Pyx_XDECREF(__pyx_t_5);
8317  __Pyx_XDECREF(__pyx_t_6);
8318  __Pyx_XDECREF(__pyx_t_7);
8319  __Pyx_XDECREF(__pyx_t_8);
8320  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8321  __pyx_r = -1;
8322  __pyx_L0:;
8323  __Pyx_RefNannyFinishContext();
8324  return __pyx_r;
8325 }
8326 
8327 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":961
8328  * raise ImportError("numpy.core.multiarray failed to import")
8329  *
8330  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8331  * try:
8332  * _import_umath()
8333  */
8334 
8335 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
8336  int __pyx_r;
8337  __Pyx_RefNannyDeclarations
8338  PyObject *__pyx_t_1 = NULL;
8339  PyObject *__pyx_t_2 = NULL;
8340  PyObject *__pyx_t_3 = NULL;
8341  int __pyx_t_4;
8342  PyObject *__pyx_t_5 = NULL;
8343  PyObject *__pyx_t_6 = NULL;
8344  PyObject *__pyx_t_7 = NULL;
8345  PyObject *__pyx_t_8 = NULL;
8346  int __pyx_lineno = 0;
8347  const char *__pyx_filename = NULL;
8348  int __pyx_clineno = 0;
8349  __Pyx_RefNannySetupContext("import_umath", 0);
8350 
8351  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":962
8352  *
8353  * cdef inline int import_umath() except -1:
8354  * try: # <<<<<<<<<<<<<<
8355  * _import_umath()
8356  * except Exception:
8357  */
8358  {
8359  __Pyx_PyThreadState_declare
8360  __Pyx_PyThreadState_assign
8361  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8362  __Pyx_XGOTREF(__pyx_t_1);
8363  __Pyx_XGOTREF(__pyx_t_2);
8364  __Pyx_XGOTREF(__pyx_t_3);
8365  /*try:*/ {
8366 
8367  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":963
8368  * cdef inline int import_umath() except -1:
8369  * try:
8370  * _import_umath() # <<<<<<<<<<<<<<
8371  * except Exception:
8372  * raise ImportError("numpy.core.umath failed to import")
8373  */
8374  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 963, __pyx_L3_error)
8375 
8376  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":962
8377  *
8378  * cdef inline int import_umath() except -1:
8379  * try: # <<<<<<<<<<<<<<
8380  * _import_umath()
8381  * except Exception:
8382  */
8383  }
8384  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8385  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8386  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8387  goto __pyx_L8_try_end;
8388  __pyx_L3_error:;
8389 
8390  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":964
8391  * try:
8392  * _import_umath()
8393  * except Exception: # <<<<<<<<<<<<<<
8394  * raise ImportError("numpy.core.umath failed to import")
8395  *
8396  */
8397  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8398  if (__pyx_t_4) {
8399  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8400  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 964, __pyx_L5_except_error)
8401  __Pyx_GOTREF(__pyx_t_5);
8402  __Pyx_GOTREF(__pyx_t_6);
8403  __Pyx_GOTREF(__pyx_t_7);
8404 
8405  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":965
8406  * _import_umath()
8407  * except Exception:
8408  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8409  *
8410  * cdef inline int import_ufunc() except -1:
8411  */
8412  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 965, __pyx_L5_except_error)
8413  __Pyx_GOTREF(__pyx_t_8);
8414  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8415  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8416  __PYX_ERR(2, 965, __pyx_L5_except_error)
8417  }
8418  goto __pyx_L5_except_error;
8419  __pyx_L5_except_error:;
8420 
8421  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":962
8422  *
8423  * cdef inline int import_umath() except -1:
8424  * try: # <<<<<<<<<<<<<<
8425  * _import_umath()
8426  * except Exception:
8427  */
8428  __Pyx_XGIVEREF(__pyx_t_1);
8429  __Pyx_XGIVEREF(__pyx_t_2);
8430  __Pyx_XGIVEREF(__pyx_t_3);
8431  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8432  goto __pyx_L1_error;
8433  __pyx_L8_try_end:;
8434  }
8435 
8436  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":961
8437  * raise ImportError("numpy.core.multiarray failed to import")
8438  *
8439  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8440  * try:
8441  * _import_umath()
8442  */
8443 
8444  /* function exit code */
8445  __pyx_r = 0;
8446  goto __pyx_L0;
8447  __pyx_L1_error:;
8448  __Pyx_XDECREF(__pyx_t_5);
8449  __Pyx_XDECREF(__pyx_t_6);
8450  __Pyx_XDECREF(__pyx_t_7);
8451  __Pyx_XDECREF(__pyx_t_8);
8452  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8453  __pyx_r = -1;
8454  __pyx_L0:;
8455  __Pyx_RefNannyFinishContext();
8456  return __pyx_r;
8457 }
8458 
8459 /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":967
8460  * raise ImportError("numpy.core.umath failed to import")
8461  *
8462  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8463  * try:
8464  * _import_umath()
8465  */
8466 
8467 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
8468  int __pyx_r;
8469  __Pyx_RefNannyDeclarations
8470  PyObject *__pyx_t_1 = NULL;
8471  PyObject *__pyx_t_2 = NULL;
8472  PyObject *__pyx_t_3 = NULL;
8473  int __pyx_t_4;
8474  PyObject *__pyx_t_5 = NULL;
8475  PyObject *__pyx_t_6 = NULL;
8476  PyObject *__pyx_t_7 = NULL;
8477  PyObject *__pyx_t_8 = NULL;
8478  int __pyx_lineno = 0;
8479  const char *__pyx_filename = NULL;
8480  int __pyx_clineno = 0;
8481  __Pyx_RefNannySetupContext("import_ufunc", 0);
8482 
8483  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":968
8484  *
8485  * cdef inline int import_ufunc() except -1:
8486  * try: # <<<<<<<<<<<<<<
8487  * _import_umath()
8488  * except Exception:
8489  */
8490  {
8491  __Pyx_PyThreadState_declare
8492  __Pyx_PyThreadState_assign
8493  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8494  __Pyx_XGOTREF(__pyx_t_1);
8495  __Pyx_XGOTREF(__pyx_t_2);
8496  __Pyx_XGOTREF(__pyx_t_3);
8497  /*try:*/ {
8498 
8499  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":969
8500  * cdef inline int import_ufunc() except -1:
8501  * try:
8502  * _import_umath() # <<<<<<<<<<<<<<
8503  * except Exception:
8504  * raise ImportError("numpy.core.umath failed to import")
8505  */
8506  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 969, __pyx_L3_error)
8507 
8508  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":968
8509  *
8510  * cdef inline int import_ufunc() except -1:
8511  * try: # <<<<<<<<<<<<<<
8512  * _import_umath()
8513  * except Exception:
8514  */
8515  }
8516  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8517  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8518  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8519  goto __pyx_L8_try_end;
8520  __pyx_L3_error:;
8521 
8522  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":970
8523  * try:
8524  * _import_umath()
8525  * except Exception: # <<<<<<<<<<<<<<
8526  * raise ImportError("numpy.core.umath failed to import")
8527  *
8528  */
8529  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8530  if (__pyx_t_4) {
8531  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8532  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 970, __pyx_L5_except_error)
8533  __Pyx_GOTREF(__pyx_t_5);
8534  __Pyx_GOTREF(__pyx_t_6);
8535  __Pyx_GOTREF(__pyx_t_7);
8536 
8537  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":971
8538  * _import_umath()
8539  * except Exception:
8540  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8541  *
8542  * cdef extern from *:
8543  */
8544  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 971, __pyx_L5_except_error)
8545  __Pyx_GOTREF(__pyx_t_8);
8546  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8547  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8548  __PYX_ERR(2, 971, __pyx_L5_except_error)
8549  }
8550  goto __pyx_L5_except_error;
8551  __pyx_L5_except_error:;
8552 
8553  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":968
8554  *
8555  * cdef inline int import_ufunc() except -1:
8556  * try: # <<<<<<<<<<<<<<
8557  * _import_umath()
8558  * except Exception:
8559  */
8560  __Pyx_XGIVEREF(__pyx_t_1);
8561  __Pyx_XGIVEREF(__pyx_t_2);
8562  __Pyx_XGIVEREF(__pyx_t_3);
8563  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8564  goto __pyx_L1_error;
8565  __pyx_L8_try_end:;
8566  }
8567 
8568  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":967
8569  * raise ImportError("numpy.core.umath failed to import")
8570  *
8571  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8572  * try:
8573  * _import_umath()
8574  */
8575 
8576  /* function exit code */
8577  __pyx_r = 0;
8578  goto __pyx_L0;
8579  __pyx_L1_error:;
8580  __Pyx_XDECREF(__pyx_t_5);
8581  __Pyx_XDECREF(__pyx_t_6);
8582  __Pyx_XDECREF(__pyx_t_7);
8583  __Pyx_XDECREF(__pyx_t_8);
8584  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8585  __pyx_r = -1;
8586  __pyx_L0:;
8587  __Pyx_RefNannyFinishContext();
8588  return __pyx_r;
8589 }
8590 
8591 /* "View.MemoryView":122
8592  * cdef bint dtype_is_object
8593  *
8594  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8595  * mode="c", bint allocate_buffer=True):
8596  *
8597  */
8598 
8599 /* Python wrapper */
8600 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8601 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8602  PyObject *__pyx_v_shape = 0;
8603  Py_ssize_t __pyx_v_itemsize;
8604  PyObject *__pyx_v_format = 0;
8605  PyObject *__pyx_v_mode = 0;
8606  int __pyx_v_allocate_buffer;
8607  int __pyx_lineno = 0;
8608  const char *__pyx_filename = NULL;
8609  int __pyx_clineno = 0;
8610  int __pyx_r;
8611  __Pyx_RefNannyDeclarations
8612  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8613  {
8614  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8615  PyObject* values[5] = {0,0,0,0,0};
8616  values[3] = ((PyObject *)__pyx_n_s_c);
8617  if (unlikely(__pyx_kwds)) {
8618  Py_ssize_t kw_args;
8619  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8620  switch (pos_args) {
8621  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8622  CYTHON_FALLTHROUGH;
8623  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8624  CYTHON_FALLTHROUGH;
8625  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8626  CYTHON_FALLTHROUGH;
8627  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8628  CYTHON_FALLTHROUGH;
8629  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8630  CYTHON_FALLTHROUGH;
8631  case 0: break;
8632  default: goto __pyx_L5_argtuple_error;
8633  }
8634  kw_args = PyDict_Size(__pyx_kwds);
8635  switch (pos_args) {
8636  case 0:
8637  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8638  else goto __pyx_L5_argtuple_error;
8639  CYTHON_FALLTHROUGH;
8640  case 1:
8641  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8642  else {
8643  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
8644  }
8645  CYTHON_FALLTHROUGH;
8646  case 2:
8647  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8648  else {
8649  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
8650  }
8651  CYTHON_FALLTHROUGH;
8652  case 3:
8653  if (kw_args > 0) {
8654  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8655  if (value) { values[3] = value; kw_args--; }
8656  }
8657  CYTHON_FALLTHROUGH;
8658  case 4:
8659  if (kw_args > 0) {
8660  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8661  if (value) { values[4] = value; kw_args--; }
8662  }
8663  }
8664  if (unlikely(kw_args > 0)) {
8665  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
8666  }
8667  } else {
8668  switch (PyTuple_GET_SIZE(__pyx_args)) {
8669  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8670  CYTHON_FALLTHROUGH;
8671  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8672  CYTHON_FALLTHROUGH;
8673  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8674  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8675  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8676  break;
8677  default: goto __pyx_L5_argtuple_error;
8678  }
8679  }
8680  __pyx_v_shape = ((PyObject*)values[0]);
8681  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8682  __pyx_v_format = values[2];
8683  __pyx_v_mode = values[3];
8684  if (values[4]) {
8685  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
8686  } else {
8687 
8688  /* "View.MemoryView":123
8689  *
8690  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
8691  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
8692  *
8693  * cdef int idx
8694  */
8695  __pyx_v_allocate_buffer = ((int)1);
8696  }
8697  }
8698  goto __pyx_L4_argument_unpacking_done;
8699  __pyx_L5_argtuple_error:;
8700  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
8701  __pyx_L3_error:;
8702  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8703  __Pyx_RefNannyFinishContext();
8704  return -1;
8705  __pyx_L4_argument_unpacking_done:;
8706  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
8707  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8708  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
8709  }
8710  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8711 
8712  /* "View.MemoryView":122
8713  * cdef bint dtype_is_object
8714  *
8715  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8716  * mode="c", bint allocate_buffer=True):
8717  *
8718  */
8719 
8720  /* function exit code */
8721  goto __pyx_L0;
8722  __pyx_L1_error:;
8723  __pyx_r = -1;
8724  __pyx_L0:;
8725  __Pyx_RefNannyFinishContext();
8726  return __pyx_r;
8727 }
8728 
8729 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
8730  int __pyx_v_idx;
8731  Py_ssize_t __pyx_v_i;
8732  Py_ssize_t __pyx_v_dim;
8733  PyObject **__pyx_v_p;
8734  char __pyx_v_order;
8735  int __pyx_r;
8736  __Pyx_RefNannyDeclarations
8737  Py_ssize_t __pyx_t_1;
8738  int __pyx_t_2;
8739  PyObject *__pyx_t_3 = NULL;
8740  int __pyx_t_4;
8741  PyObject *__pyx_t_5 = NULL;
8742  PyObject *__pyx_t_6 = NULL;
8743  char *__pyx_t_7;
8744  int __pyx_t_8;
8745  Py_ssize_t __pyx_t_9;
8746  PyObject *__pyx_t_10 = NULL;
8747  Py_ssize_t __pyx_t_11;
8748  int __pyx_lineno = 0;
8749  const char *__pyx_filename = NULL;
8750  int __pyx_clineno = 0;
8751  __Pyx_RefNannySetupContext("__cinit__", 0);
8752  __Pyx_INCREF(__pyx_v_format);
8753 
8754  /* "View.MemoryView":129
8755  * cdef PyObject **p
8756  *
8757  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
8758  * self.itemsize = itemsize
8759  *
8760  */
8761  if (unlikely(__pyx_v_shape == Py_None)) {
8762  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8763  __PYX_ERR(1, 129, __pyx_L1_error)
8764  }
8765  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
8766  __pyx_v_self->ndim = ((int)__pyx_t_1);
8767 
8768  /* "View.MemoryView":130
8769  *
8770  * self.ndim = <int> len(shape)
8771  * self.itemsize = itemsize # <<<<<<<<<<<<<<
8772  *
8773  * if not self.ndim:
8774  */
8775  __pyx_v_self->itemsize = __pyx_v_itemsize;
8776 
8777  /* "View.MemoryView":132
8778  * self.itemsize = itemsize
8779  *
8780  * if not self.ndim: # <<<<<<<<<<<<<<
8781  * raise ValueError("Empty shape tuple for cython.array")
8782  *
8783  */
8784  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8785  if (unlikely(__pyx_t_2)) {
8786 
8787  /* "View.MemoryView":133
8788  *
8789  * if not self.ndim:
8790  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
8791  *
8792  * if itemsize <= 0:
8793  */
8794  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
8795  __Pyx_GOTREF(__pyx_t_3);
8796  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8797  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8798  __PYX_ERR(1, 133, __pyx_L1_error)
8799 
8800  /* "View.MemoryView":132
8801  * self.itemsize = itemsize
8802  *
8803  * if not self.ndim: # <<<<<<<<<<<<<<
8804  * raise ValueError("Empty shape tuple for cython.array")
8805  *
8806  */
8807  }
8808 
8809  /* "View.MemoryView":135
8810  * raise ValueError("Empty shape tuple for cython.array")
8811  *
8812  * if itemsize <= 0: # <<<<<<<<<<<<<<
8813  * raise ValueError("itemsize <= 0 for cython.array")
8814  *
8815  */
8816  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8817  if (unlikely(__pyx_t_2)) {
8818 
8819  /* "View.MemoryView":136
8820  *
8821  * if itemsize <= 0:
8822  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
8823  *
8824  * if not isinstance(format, bytes):
8825  */
8826  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
8827  __Pyx_GOTREF(__pyx_t_3);
8828  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8829  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8830  __PYX_ERR(1, 136, __pyx_L1_error)
8831 
8832  /* "View.MemoryView":135
8833  * raise ValueError("Empty shape tuple for cython.array")
8834  *
8835  * if itemsize <= 0: # <<<<<<<<<<<<<<
8836  * raise ValueError("itemsize <= 0 for cython.array")
8837  *
8838  */
8839  }
8840 
8841  /* "View.MemoryView":138
8842  * raise ValueError("itemsize <= 0 for cython.array")
8843  *
8844  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8845  * format = format.encode('ASCII')
8846  * self._format = format # keep a reference to the byte string
8847  */
8848  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8849  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8850  if (__pyx_t_4) {
8851 
8852  /* "View.MemoryView":139
8853  *
8854  * if not isinstance(format, bytes):
8855  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
8856  * self._format = format # keep a reference to the byte string
8857  * self.format = self._format
8858  */
8859  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
8860  __Pyx_GOTREF(__pyx_t_5);
8861  __pyx_t_6 = NULL;
8862  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8863  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8864  if (likely(__pyx_t_6)) {
8865  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8866  __Pyx_INCREF(__pyx_t_6);
8867  __Pyx_INCREF(function);
8868  __Pyx_DECREF_SET(__pyx_t_5, function);
8869  }
8870  }
8871  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
8872  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8873  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
8874  __Pyx_GOTREF(__pyx_t_3);
8875  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8876  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8877  __pyx_t_3 = 0;
8878 
8879  /* "View.MemoryView":138
8880  * raise ValueError("itemsize <= 0 for cython.array")
8881  *
8882  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8883  * format = format.encode('ASCII')
8884  * self._format = format # keep a reference to the byte string
8885  */
8886  }
8887 
8888  /* "View.MemoryView":140
8889  * if not isinstance(format, bytes):
8890  * format = format.encode('ASCII')
8891  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
8892  * self.format = self._format
8893  *
8894  */
8895  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
8896  __pyx_t_3 = __pyx_v_format;
8897  __Pyx_INCREF(__pyx_t_3);
8898  __Pyx_GIVEREF(__pyx_t_3);
8899  __Pyx_GOTREF(__pyx_v_self->_format);
8900  __Pyx_DECREF(__pyx_v_self->_format);
8901  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8902  __pyx_t_3 = 0;
8903 
8904  /* "View.MemoryView":141
8905  * format = format.encode('ASCII')
8906  * self._format = format # keep a reference to the byte string
8907  * self.format = self._format # <<<<<<<<<<<<<<
8908  *
8909  *
8910  */
8911  if (unlikely(__pyx_v_self->_format == Py_None)) {
8912  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8913  __PYX_ERR(1, 141, __pyx_L1_error)
8914  }
8915  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
8916  __pyx_v_self->format = __pyx_t_7;
8917 
8918  /* "View.MemoryView":144
8919  *
8920  *
8921  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
8922  * self._strides = self._shape + self.ndim
8923  *
8924  */
8925  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8926 
8927  /* "View.MemoryView":145
8928  *
8929  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8930  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
8931  *
8932  * if not self._shape:
8933  */
8934  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8935 
8936  /* "View.MemoryView":147
8937  * self._strides = self._shape + self.ndim
8938  *
8939  * if not self._shape: # <<<<<<<<<<<<<<
8940  * raise MemoryError("unable to allocate shape and strides.")
8941  *
8942  */
8943  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8944  if (unlikely(__pyx_t_4)) {
8945 
8946  /* "View.MemoryView":148
8947  *
8948  * if not self._shape:
8949  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8950  *
8951  *
8952  */
8953  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8954  __Pyx_GOTREF(__pyx_t_3);
8955  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8956  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8957  __PYX_ERR(1, 148, __pyx_L1_error)
8958 
8959  /* "View.MemoryView":147
8960  * self._strides = self._shape + self.ndim
8961  *
8962  * if not self._shape: # <<<<<<<<<<<<<<
8963  * raise MemoryError("unable to allocate shape and strides.")
8964  *
8965  */
8966  }
8967 
8968  /* "View.MemoryView":151
8969  *
8970  *
8971  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8972  * if dim <= 0:
8973  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8974  */
8975  __pyx_t_8 = 0;
8976  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8977  for (;;) {
8978  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8979  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8980  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
8981  #else
8982  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
8983  __Pyx_GOTREF(__pyx_t_5);
8984  #endif
8985  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
8986  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8987  __pyx_v_dim = __pyx_t_9;
8988  __pyx_v_idx = __pyx_t_8;
8989  __pyx_t_8 = (__pyx_t_8 + 1);
8990 
8991  /* "View.MemoryView":152
8992  *
8993  * for idx, dim in enumerate(shape):
8994  * if dim <= 0: # <<<<<<<<<<<<<<
8995  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8996  * self._shape[idx] = dim
8997  */
8998  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8999  if (unlikely(__pyx_t_4)) {
9000 
9001  /* "View.MemoryView":153
9002  * for idx, dim in enumerate(shape):
9003  * if dim <= 0:
9004  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
9005  * self._shape[idx] = dim
9006  *
9007  */
9008  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
9009  __Pyx_GOTREF(__pyx_t_5);
9010  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
9011  __Pyx_GOTREF(__pyx_t_6);
9012  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
9013  __Pyx_GOTREF(__pyx_t_10);
9014  __Pyx_GIVEREF(__pyx_t_5);
9015  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
9016  __Pyx_GIVEREF(__pyx_t_6);
9017  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
9018  __pyx_t_5 = 0;
9019  __pyx_t_6 = 0;
9020  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
9021  __Pyx_GOTREF(__pyx_t_6);
9022  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9023  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
9024  __Pyx_GOTREF(__pyx_t_10);
9025  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9026  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9027  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9028  __PYX_ERR(1, 153, __pyx_L1_error)
9029 
9030  /* "View.MemoryView":152
9031  *
9032  * for idx, dim in enumerate(shape):
9033  * if dim <= 0: # <<<<<<<<<<<<<<
9034  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9035  * self._shape[idx] = dim
9036  */
9037  }
9038 
9039  /* "View.MemoryView":154
9040  * if dim <= 0:
9041  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9042  * self._shape[idx] = dim # <<<<<<<<<<<<<<
9043  *
9044  * cdef char order
9045  */
9046  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
9047 
9048  /* "View.MemoryView":151
9049  *
9050  *
9051  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
9052  * if dim <= 0:
9053  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9054  */
9055  }
9056  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9057 
9058  /* "View.MemoryView":157
9059  *
9060  * cdef char order
9061  * if mode == 'fortran': # <<<<<<<<<<<<<<
9062  * order = b'F'
9063  * self.mode = u'fortran'
9064  */
9065  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
9066  if (__pyx_t_4) {
9067 
9068  /* "View.MemoryView":158
9069  * cdef char order
9070  * if mode == 'fortran':
9071  * order = b'F' # <<<<<<<<<<<<<<
9072  * self.mode = u'fortran'
9073  * elif mode == 'c':
9074  */
9075  __pyx_v_order = 'F';
9076 
9077  /* "View.MemoryView":159
9078  * if mode == 'fortran':
9079  * order = b'F'
9080  * self.mode = u'fortran' # <<<<<<<<<<<<<<
9081  * elif mode == 'c':
9082  * order = b'C'
9083  */
9084  __Pyx_INCREF(__pyx_n_u_fortran);
9085  __Pyx_GIVEREF(__pyx_n_u_fortran);
9086  __Pyx_GOTREF(__pyx_v_self->mode);
9087  __Pyx_DECREF(__pyx_v_self->mode);
9088  __pyx_v_self->mode = __pyx_n_u_fortran;
9089 
9090  /* "View.MemoryView":157
9091  *
9092  * cdef char order
9093  * if mode == 'fortran': # <<<<<<<<<<<<<<
9094  * order = b'F'
9095  * self.mode = u'fortran'
9096  */
9097  goto __pyx_L10;
9098  }
9099 
9100  /* "View.MemoryView":160
9101  * order = b'F'
9102  * self.mode = u'fortran'
9103  * elif mode == 'c': # <<<<<<<<<<<<<<
9104  * order = b'C'
9105  * self.mode = u'c'
9106  */
9107  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
9108  if (likely(__pyx_t_4)) {
9109 
9110  /* "View.MemoryView":161
9111  * self.mode = u'fortran'
9112  * elif mode == 'c':
9113  * order = b'C' # <<<<<<<<<<<<<<
9114  * self.mode = u'c'
9115  * else:
9116  */
9117  __pyx_v_order = 'C';
9118 
9119  /* "View.MemoryView":162
9120  * elif mode == 'c':
9121  * order = b'C'
9122  * self.mode = u'c' # <<<<<<<<<<<<<<
9123  * else:
9124  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
9125  */
9126  __Pyx_INCREF(__pyx_n_u_c);
9127  __Pyx_GIVEREF(__pyx_n_u_c);
9128  __Pyx_GOTREF(__pyx_v_self->mode);
9129  __Pyx_DECREF(__pyx_v_self->mode);
9130  __pyx_v_self->mode = __pyx_n_u_c;
9131 
9132  /* "View.MemoryView":160
9133  * order = b'F'
9134  * self.mode = u'fortran'
9135  * elif mode == 'c': # <<<<<<<<<<<<<<
9136  * order = b'C'
9137  * self.mode = u'c'
9138  */
9139  goto __pyx_L10;
9140  }
9141 
9142  /* "View.MemoryView":164
9143  * self.mode = u'c'
9144  * else:
9145  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
9146  *
9147  * self.len = fill_contig_strides_array(self._shape, self._strides,
9148  */
9149  /*else*/ {
9150  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
9151  __Pyx_GOTREF(__pyx_t_3);
9152  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
9153  __Pyx_GOTREF(__pyx_t_10);
9154  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9155  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9156  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9157  __PYX_ERR(1, 164, __pyx_L1_error)
9158  }
9159  __pyx_L10:;
9160 
9161  /* "View.MemoryView":166
9162  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
9163  *
9164  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
9165  * itemsize, self.ndim, order)
9166  *
9167  */
9168  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
9169 
9170  /* "View.MemoryView":169
9171  * itemsize, self.ndim, order)
9172  *
9173  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
9174  * self.dtype_is_object = format == b'O'
9175  * if allocate_buffer:
9176  */
9177  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
9178 
9179  /* "View.MemoryView":170
9180  *
9181  * self.free_data = allocate_buffer
9182  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
9183  * if allocate_buffer:
9184  *
9185  */
9186  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
9187  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
9188  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9189  __pyx_v_self->dtype_is_object = __pyx_t_4;
9190 
9191  /* "View.MemoryView":171
9192  * self.free_data = allocate_buffer
9193  * self.dtype_is_object = format == b'O'
9194  * if allocate_buffer: # <<<<<<<<<<<<<<
9195  *
9196  *
9197  */
9198  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9199  if (__pyx_t_4) {
9200 
9201  /* "View.MemoryView":174
9202  *
9203  *
9204  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
9205  * if not self.data:
9206  * raise MemoryError("unable to allocate array data.")
9207  */
9208  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
9209 
9210  /* "View.MemoryView":175
9211  *
9212  * self.data = <char *>malloc(self.len)
9213  * if not self.data: # <<<<<<<<<<<<<<
9214  * raise MemoryError("unable to allocate array data.")
9215  *
9216  */
9217  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9218  if (unlikely(__pyx_t_4)) {
9219 
9220  /* "View.MemoryView":176
9221  * self.data = <char *>malloc(self.len)
9222  * if not self.data:
9223  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
9224  *
9225  * if self.dtype_is_object:
9226  */
9227  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
9228  __Pyx_GOTREF(__pyx_t_10);
9229  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9230  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9231  __PYX_ERR(1, 176, __pyx_L1_error)
9232 
9233  /* "View.MemoryView":175
9234  *
9235  * self.data = <char *>malloc(self.len)
9236  * if not self.data: # <<<<<<<<<<<<<<
9237  * raise MemoryError("unable to allocate array data.")
9238  *
9239  */
9240  }
9241 
9242  /* "View.MemoryView":178
9243  * raise MemoryError("unable to allocate array data.")
9244  *
9245  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9246  * p = <PyObject **> self.data
9247  * for i in range(self.len / itemsize):
9248  */
9249  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9250  if (__pyx_t_4) {
9251 
9252  /* "View.MemoryView":179
9253  *
9254  * if self.dtype_is_object:
9255  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
9256  * for i in range(self.len / itemsize):
9257  * p[i] = Py_None
9258  */
9259  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9260 
9261  /* "View.MemoryView":180
9262  * if self.dtype_is_object:
9263  * p = <PyObject **> self.data
9264  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
9265  * p[i] = Py_None
9266  * Py_INCREF(Py_None)
9267  */
9268  if (unlikely(__pyx_v_itemsize == 0)) {
9269  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
9270  __PYX_ERR(1, 180, __pyx_L1_error)
9271  }
9272  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9273  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
9274  __PYX_ERR(1, 180, __pyx_L1_error)
9275  }
9276  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9277  __pyx_t_9 = __pyx_t_1;
9278  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
9279  __pyx_v_i = __pyx_t_11;
9280 
9281  /* "View.MemoryView":181
9282  * p = <PyObject **> self.data
9283  * for i in range(self.len / itemsize):
9284  * p[i] = Py_None # <<<<<<<<<<<<<<
9285  * Py_INCREF(Py_None)
9286  *
9287  */
9288  (__pyx_v_p[__pyx_v_i]) = Py_None;
9289 
9290  /* "View.MemoryView":182
9291  * for i in range(self.len / itemsize):
9292  * p[i] = Py_None
9293  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9294  *
9295  * @cname('getbuffer')
9296  */
9297  Py_INCREF(Py_None);
9298  }
9299 
9300  /* "View.MemoryView":178
9301  * raise MemoryError("unable to allocate array data.")
9302  *
9303  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9304  * p = <PyObject **> self.data
9305  * for i in range(self.len / itemsize):
9306  */
9307  }
9308 
9309  /* "View.MemoryView":171
9310  * self.free_data = allocate_buffer
9311  * self.dtype_is_object = format == b'O'
9312  * if allocate_buffer: # <<<<<<<<<<<<<<
9313  *
9314  *
9315  */
9316  }
9317 
9318  /* "View.MemoryView":122
9319  * cdef bint dtype_is_object
9320  *
9321  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9322  * mode="c", bint allocate_buffer=True):
9323  *
9324  */
9325 
9326  /* function exit code */
9327  __pyx_r = 0;
9328  goto __pyx_L0;
9329  __pyx_L1_error:;
9330  __Pyx_XDECREF(__pyx_t_3);
9331  __Pyx_XDECREF(__pyx_t_5);
9332  __Pyx_XDECREF(__pyx_t_6);
9333  __Pyx_XDECREF(__pyx_t_10);
9334  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9335  __pyx_r = -1;
9336  __pyx_L0:;
9337  __Pyx_XDECREF(__pyx_v_format);
9338  __Pyx_RefNannyFinishContext();
9339  return __pyx_r;
9340 }
9341 
9342 /* "View.MemoryView":185
9343  *
9344  * @cname('getbuffer')
9345  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9346  * cdef int bufmode = -1
9347  * if self.mode == u"c":
9348  */
9349 
9350 /* Python wrapper */
9351 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9352 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9353  int __pyx_r;
9354  __Pyx_RefNannyDeclarations
9355  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9356  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9357 
9358  /* function exit code */
9359  __Pyx_RefNannyFinishContext();
9360  return __pyx_r;
9361 }
9362 
9363 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9364  int __pyx_v_bufmode;
9365  int __pyx_r;
9366  __Pyx_RefNannyDeclarations
9367  int __pyx_t_1;
9368  int __pyx_t_2;
9369  PyObject *__pyx_t_3 = NULL;
9370  char *__pyx_t_4;
9371  Py_ssize_t __pyx_t_5;
9372  int __pyx_t_6;
9373  Py_ssize_t *__pyx_t_7;
9374  int __pyx_lineno = 0;
9375  const char *__pyx_filename = NULL;
9376  int __pyx_clineno = 0;
9377  if (__pyx_v_info == NULL) {
9378  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9379  return -1;
9380  }
9381  __Pyx_RefNannySetupContext("__getbuffer__", 0);
9382  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9383  __Pyx_GIVEREF(__pyx_v_info->obj);
9384 
9385  /* "View.MemoryView":186
9386  * @cname('getbuffer')
9387  * def __getbuffer__(self, Py_buffer *info, int flags):
9388  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
9389  * if self.mode == u"c":
9390  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9391  */
9392  __pyx_v_bufmode = -1;
9393 
9394  /* "View.MemoryView":187
9395  * def __getbuffer__(self, Py_buffer *info, int flags):
9396  * cdef int bufmode = -1
9397  * if self.mode == u"c": # <<<<<<<<<<<<<<
9398  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9399  * elif self.mode == u"fortran":
9400  */
9401  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
9402  __pyx_t_2 = (__pyx_t_1 != 0);
9403  if (__pyx_t_2) {
9404 
9405  /* "View.MemoryView":188
9406  * cdef int bufmode = -1
9407  * if self.mode == u"c":
9408  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9409  * elif self.mode == u"fortran":
9410  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9411  */
9412  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9413 
9414  /* "View.MemoryView":187
9415  * def __getbuffer__(self, Py_buffer *info, int flags):
9416  * cdef int bufmode = -1
9417  * if self.mode == u"c": # <<<<<<<<<<<<<<
9418  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9419  * elif self.mode == u"fortran":
9420  */
9421  goto __pyx_L3;
9422  }
9423 
9424  /* "View.MemoryView":189
9425  * if self.mode == u"c":
9426  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9427  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9428  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9429  * if not (flags & bufmode):
9430  */
9431  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
9432  __pyx_t_1 = (__pyx_t_2 != 0);
9433  if (__pyx_t_1) {
9434 
9435  /* "View.MemoryView":190
9436  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9437  * elif self.mode == u"fortran":
9438  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9439  * if not (flags & bufmode):
9440  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9441  */
9442  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9443 
9444  /* "View.MemoryView":189
9445  * if self.mode == u"c":
9446  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9447  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9448  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9449  * if not (flags & bufmode):
9450  */
9451  }
9452  __pyx_L3:;
9453 
9454  /* "View.MemoryView":191
9455  * elif self.mode == u"fortran":
9456  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9457  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9458  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9459  * info.buf = self.data
9460  */
9461  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9462  if (unlikely(__pyx_t_1)) {
9463 
9464  /* "View.MemoryView":192
9465  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9466  * if not (flags & bufmode):
9467  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
9468  * info.buf = self.data
9469  * info.len = self.len
9470  */
9471  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
9472  __Pyx_GOTREF(__pyx_t_3);
9473  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9474  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9475  __PYX_ERR(1, 192, __pyx_L1_error)
9476 
9477  /* "View.MemoryView":191
9478  * elif self.mode == u"fortran":
9479  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9480  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9481  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9482  * info.buf = self.data
9483  */
9484  }
9485 
9486  /* "View.MemoryView":193
9487  * if not (flags & bufmode):
9488  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9489  * info.buf = self.data # <<<<<<<<<<<<<<
9490  * info.len = self.len
9491  * info.ndim = self.ndim
9492  */
9493  __pyx_t_4 = __pyx_v_self->data;
9494  __pyx_v_info->buf = __pyx_t_4;
9495 
9496  /* "View.MemoryView":194
9497  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9498  * info.buf = self.data
9499  * info.len = self.len # <<<<<<<<<<<<<<
9500  * info.ndim = self.ndim
9501  * info.shape = self._shape
9502  */
9503  __pyx_t_5 = __pyx_v_self->len;
9504  __pyx_v_info->len = __pyx_t_5;
9505 
9506  /* "View.MemoryView":195
9507  * info.buf = self.data
9508  * info.len = self.len
9509  * info.ndim = self.ndim # <<<<<<<<<<<<<<
9510  * info.shape = self._shape
9511  * info.strides = self._strides
9512  */
9513  __pyx_t_6 = __pyx_v_self->ndim;
9514  __pyx_v_info->ndim = __pyx_t_6;
9515 
9516  /* "View.MemoryView":196
9517  * info.len = self.len
9518  * info.ndim = self.ndim
9519  * info.shape = self._shape # <<<<<<<<<<<<<<
9520  * info.strides = self._strides
9521  * info.suboffsets = NULL
9522  */
9523  __pyx_t_7 = __pyx_v_self->_shape;
9524  __pyx_v_info->shape = __pyx_t_7;
9525 
9526  /* "View.MemoryView":197
9527  * info.ndim = self.ndim
9528  * info.shape = self._shape
9529  * info.strides = self._strides # <<<<<<<<<<<<<<
9530  * info.suboffsets = NULL
9531  * info.itemsize = self.itemsize
9532  */
9533  __pyx_t_7 = __pyx_v_self->_strides;
9534  __pyx_v_info->strides = __pyx_t_7;
9535 
9536  /* "View.MemoryView":198
9537  * info.shape = self._shape
9538  * info.strides = self._strides
9539  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9540  * info.itemsize = self.itemsize
9541  * info.readonly = 0
9542  */
9543  __pyx_v_info->suboffsets = NULL;
9544 
9545  /* "View.MemoryView":199
9546  * info.strides = self._strides
9547  * info.suboffsets = NULL
9548  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
9549  * info.readonly = 0
9550  *
9551  */
9552  __pyx_t_5 = __pyx_v_self->itemsize;
9553  __pyx_v_info->itemsize = __pyx_t_5;
9554 
9555  /* "View.MemoryView":200
9556  * info.suboffsets = NULL
9557  * info.itemsize = self.itemsize
9558  * info.readonly = 0 # <<<<<<<<<<<<<<
9559  *
9560  * if flags & PyBUF_FORMAT:
9561  */
9562  __pyx_v_info->readonly = 0;
9563 
9564  /* "View.MemoryView":202
9565  * info.readonly = 0
9566  *
9567  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9568  * info.format = self.format
9569  * else:
9570  */
9571  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9572  if (__pyx_t_1) {
9573 
9574  /* "View.MemoryView":203
9575  *
9576  * if flags & PyBUF_FORMAT:
9577  * info.format = self.format # <<<<<<<<<<<<<<
9578  * else:
9579  * info.format = NULL
9580  */
9581  __pyx_t_4 = __pyx_v_self->format;
9582  __pyx_v_info->format = __pyx_t_4;
9583 
9584  /* "View.MemoryView":202
9585  * info.readonly = 0
9586  *
9587  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9588  * info.format = self.format
9589  * else:
9590  */
9591  goto __pyx_L5;
9592  }
9593 
9594  /* "View.MemoryView":205
9595  * info.format = self.format
9596  * else:
9597  * info.format = NULL # <<<<<<<<<<<<<<
9598  *
9599  * info.obj = self
9600  */
9601  /*else*/ {
9602  __pyx_v_info->format = NULL;
9603  }
9604  __pyx_L5:;
9605 
9606  /* "View.MemoryView":207
9607  * info.format = NULL
9608  *
9609  * info.obj = self # <<<<<<<<<<<<<<
9610  *
9611  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9612  */
9613  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9614  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9615  __Pyx_GOTREF(__pyx_v_info->obj);
9616  __Pyx_DECREF(__pyx_v_info->obj);
9617  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9618 
9619  /* "View.MemoryView":185
9620  *
9621  * @cname('getbuffer')
9622  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9623  * cdef int bufmode = -1
9624  * if self.mode == u"c":
9625  */
9626 
9627  /* function exit code */
9628  __pyx_r = 0;
9629  goto __pyx_L0;
9630  __pyx_L1_error:;
9631  __Pyx_XDECREF(__pyx_t_3);
9632  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9633  __pyx_r = -1;
9634  if (__pyx_v_info->obj != NULL) {
9635  __Pyx_GOTREF(__pyx_v_info->obj);
9636  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9637  }
9638  goto __pyx_L2;
9639  __pyx_L0:;
9640  if (__pyx_v_info->obj == Py_None) {
9641  __Pyx_GOTREF(__pyx_v_info->obj);
9642  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9643  }
9644  __pyx_L2:;
9645  __Pyx_RefNannyFinishContext();
9646  return __pyx_r;
9647 }
9648 
9649 /* "View.MemoryView":211
9650  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9651  *
9652  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9653  * if self.callback_free_data != NULL:
9654  * self.callback_free_data(self.data)
9655  */
9656 
9657 /* Python wrapper */
9658 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
9659 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9660  __Pyx_RefNannyDeclarations
9661  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9662  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
9663 
9664  /* function exit code */
9665  __Pyx_RefNannyFinishContext();
9666 }
9667 
9668 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
9669  __Pyx_RefNannyDeclarations
9670  int __pyx_t_1;
9671  __Pyx_RefNannySetupContext("__dealloc__", 0);
9672 
9673  /* "View.MemoryView":212
9674  *
9675  * def __dealloc__(array self):
9676  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9677  * self.callback_free_data(self.data)
9678  * elif self.free_data:
9679  */
9680  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9681  if (__pyx_t_1) {
9682 
9683  /* "View.MemoryView":213
9684  * def __dealloc__(array self):
9685  * if self.callback_free_data != NULL:
9686  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
9687  * elif self.free_data:
9688  * if self.dtype_is_object:
9689  */
9690  __pyx_v_self->callback_free_data(__pyx_v_self->data);
9691 
9692  /* "View.MemoryView":212
9693  *
9694  * def __dealloc__(array self):
9695  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9696  * self.callback_free_data(self.data)
9697  * elif self.free_data:
9698  */
9699  goto __pyx_L3;
9700  }
9701 
9702  /* "View.MemoryView":214
9703  * if self.callback_free_data != NULL:
9704  * self.callback_free_data(self.data)
9705  * elif self.free_data: # <<<<<<<<<<<<<<
9706  * if self.dtype_is_object:
9707  * refcount_objects_in_slice(self.data, self._shape,
9708  */
9709  __pyx_t_1 = (__pyx_v_self->free_data != 0);
9710  if (__pyx_t_1) {
9711 
9712  /* "View.MemoryView":215
9713  * self.callback_free_data(self.data)
9714  * elif self.free_data:
9715  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9716  * refcount_objects_in_slice(self.data, self._shape,
9717  * self._strides, self.ndim, False)
9718  */
9719  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9720  if (__pyx_t_1) {
9721 
9722  /* "View.MemoryView":216
9723  * elif self.free_data:
9724  * if self.dtype_is_object:
9725  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
9726  * self._strides, self.ndim, False)
9727  * free(self.data)
9728  */
9729  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9730 
9731  /* "View.MemoryView":215
9732  * self.callback_free_data(self.data)
9733  * elif self.free_data:
9734  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9735  * refcount_objects_in_slice(self.data, self._shape,
9736  * self._strides, self.ndim, False)
9737  */
9738  }
9739 
9740  /* "View.MemoryView":218
9741  * refcount_objects_in_slice(self.data, self._shape,
9742  * self._strides, self.ndim, False)
9743  * free(self.data) # <<<<<<<<<<<<<<
9744  * PyObject_Free(self._shape)
9745  *
9746  */
9747  free(__pyx_v_self->data);
9748 
9749  /* "View.MemoryView":214
9750  * if self.callback_free_data != NULL:
9751  * self.callback_free_data(self.data)
9752  * elif self.free_data: # <<<<<<<<<<<<<<
9753  * if self.dtype_is_object:
9754  * refcount_objects_in_slice(self.data, self._shape,
9755  */
9756  }
9757  __pyx_L3:;
9758 
9759  /* "View.MemoryView":219
9760  * self._strides, self.ndim, False)
9761  * free(self.data)
9762  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
9763  *
9764  * @property
9765  */
9766  PyObject_Free(__pyx_v_self->_shape);
9767 
9768  /* "View.MemoryView":211
9769  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9770  *
9771  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9772  * if self.callback_free_data != NULL:
9773  * self.callback_free_data(self.data)
9774  */
9775 
9776  /* function exit code */
9777  __Pyx_RefNannyFinishContext();
9778 }
9779 
9780 /* "View.MemoryView":222
9781  *
9782  * @property
9783  * def memview(self): # <<<<<<<<<<<<<<
9784  * return self.get_memview()
9785  *
9786  */
9787 
9788 /* Python wrapper */
9789 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
9790 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9791  PyObject *__pyx_r = 0;
9792  __Pyx_RefNannyDeclarations
9793  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9794  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
9795 
9796  /* function exit code */
9797  __Pyx_RefNannyFinishContext();
9798  return __pyx_r;
9799 }
9800 
9801 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
9802  PyObject *__pyx_r = NULL;
9803  __Pyx_RefNannyDeclarations
9804  PyObject *__pyx_t_1 = NULL;
9805  int __pyx_lineno = 0;
9806  const char *__pyx_filename = NULL;
9807  int __pyx_clineno = 0;
9808  __Pyx_RefNannySetupContext("__get__", 0);
9809 
9810  /* "View.MemoryView":223
9811  * @property
9812  * def memview(self):
9813  * return self.get_memview() # <<<<<<<<<<<<<<
9814  *
9815  * @cname('get_memview')
9816  */
9817  __Pyx_XDECREF(__pyx_r);
9818  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
9819  __Pyx_GOTREF(__pyx_t_1);
9820  __pyx_r = __pyx_t_1;
9821  __pyx_t_1 = 0;
9822  goto __pyx_L0;
9823 
9824  /* "View.MemoryView":222
9825  *
9826  * @property
9827  * def memview(self): # <<<<<<<<<<<<<<
9828  * return self.get_memview()
9829  *
9830  */
9831 
9832  /* function exit code */
9833  __pyx_L1_error:;
9834  __Pyx_XDECREF(__pyx_t_1);
9835  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9836  __pyx_r = NULL;
9837  __pyx_L0:;
9838  __Pyx_XGIVEREF(__pyx_r);
9839  __Pyx_RefNannyFinishContext();
9840  return __pyx_r;
9841 }
9842 
9843 /* "View.MemoryView":226
9844  *
9845  * @cname('get_memview')
9846  * cdef get_memview(self): # <<<<<<<<<<<<<<
9847  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9848  * return memoryview(self, flags, self.dtype_is_object)
9849  */
9850 
9851 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
9852  int __pyx_v_flags;
9853  PyObject *__pyx_r = NULL;
9854  __Pyx_RefNannyDeclarations
9855  PyObject *__pyx_t_1 = NULL;
9856  PyObject *__pyx_t_2 = NULL;
9857  PyObject *__pyx_t_3 = NULL;
9858  int __pyx_lineno = 0;
9859  const char *__pyx_filename = NULL;
9860  int __pyx_clineno = 0;
9861  __Pyx_RefNannySetupContext("get_memview", 0);
9862 
9863  /* "View.MemoryView":227
9864  * @cname('get_memview')
9865  * cdef get_memview(self):
9866  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
9867  * return memoryview(self, flags, self.dtype_is_object)
9868  *
9869  */
9870  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9871 
9872  /* "View.MemoryView":228
9873  * cdef get_memview(self):
9874  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9875  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
9876  *
9877  * def __len__(self):
9878  */
9879  __Pyx_XDECREF(__pyx_r);
9880  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
9881  __Pyx_GOTREF(__pyx_t_1);
9882  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9883  __Pyx_GOTREF(__pyx_t_2);
9884  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
9885  __Pyx_GOTREF(__pyx_t_3);
9886  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9887  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9888  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9889  __Pyx_GIVEREF(__pyx_t_1);
9890  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9891  __Pyx_GIVEREF(__pyx_t_2);
9892  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9893  __pyx_t_1 = 0;
9894  __pyx_t_2 = 0;
9895  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9896  __Pyx_GOTREF(__pyx_t_2);
9897  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9898  __pyx_r = __pyx_t_2;
9899  __pyx_t_2 = 0;
9900  goto __pyx_L0;
9901 
9902  /* "View.MemoryView":226
9903  *
9904  * @cname('get_memview')
9905  * cdef get_memview(self): # <<<<<<<<<<<<<<
9906  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9907  * return memoryview(self, flags, self.dtype_is_object)
9908  */
9909 
9910  /* function exit code */
9911  __pyx_L1_error:;
9912  __Pyx_XDECREF(__pyx_t_1);
9913  __Pyx_XDECREF(__pyx_t_2);
9914  __Pyx_XDECREF(__pyx_t_3);
9915  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9916  __pyx_r = 0;
9917  __pyx_L0:;
9918  __Pyx_XGIVEREF(__pyx_r);
9919  __Pyx_RefNannyFinishContext();
9920  return __pyx_r;
9921 }
9922 
9923 /* "View.MemoryView":230
9924  * return memoryview(self, flags, self.dtype_is_object)
9925  *
9926  * def __len__(self): # <<<<<<<<<<<<<<
9927  * return self._shape[0]
9928  *
9929  */
9930 
9931 /* Python wrapper */
9932 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9933 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9934  Py_ssize_t __pyx_r;
9935  __Pyx_RefNannyDeclarations
9936  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9937  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9938 
9939  /* function exit code */
9940  __Pyx_RefNannyFinishContext();
9941  return __pyx_r;
9942 }
9943 
9944 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9945  Py_ssize_t __pyx_r;
9946  __Pyx_RefNannyDeclarations
9947  __Pyx_RefNannySetupContext("__len__", 0);
9948 
9949  /* "View.MemoryView":231
9950  *
9951  * def __len__(self):
9952  * return self._shape[0] # <<<<<<<<<<<<<<
9953  *
9954  * def __getattr__(self, attr):
9955  */
9956  __pyx_r = (__pyx_v_self->_shape[0]);
9957  goto __pyx_L0;
9958 
9959  /* "View.MemoryView":230
9960  * return memoryview(self, flags, self.dtype_is_object)
9961  *
9962  * def __len__(self): # <<<<<<<<<<<<<<
9963  * return self._shape[0]
9964  *
9965  */
9966 
9967  /* function exit code */
9968  __pyx_L0:;
9969  __Pyx_RefNannyFinishContext();
9970  return __pyx_r;
9971 }
9972 
9973 /* "View.MemoryView":233
9974  * return self._shape[0]
9975  *
9976  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9977  * return getattr(self.memview, attr)
9978  *
9979  */
9980 
9981 /* Python wrapper */
9982 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9983 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9984  PyObject *__pyx_r = 0;
9985  __Pyx_RefNannyDeclarations
9986  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9987  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9988 
9989  /* function exit code */
9990  __Pyx_RefNannyFinishContext();
9991  return __pyx_r;
9992 }
9993 
9994 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9995  PyObject *__pyx_r = NULL;
9996  __Pyx_RefNannyDeclarations
9997  PyObject *__pyx_t_1 = NULL;
9998  PyObject *__pyx_t_2 = NULL;
9999  int __pyx_lineno = 0;
10000  const char *__pyx_filename = NULL;
10001  int __pyx_clineno = 0;
10002  __Pyx_RefNannySetupContext("__getattr__", 0);
10003 
10004  /* "View.MemoryView":234
10005  *
10006  * def __getattr__(self, attr):
10007  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
10008  *
10009  * def __getitem__(self, item):
10010  */
10011  __Pyx_XDECREF(__pyx_r);
10012  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
10013  __Pyx_GOTREF(__pyx_t_1);
10014  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
10015  __Pyx_GOTREF(__pyx_t_2);
10016  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10017  __pyx_r = __pyx_t_2;
10018  __pyx_t_2 = 0;
10019  goto __pyx_L0;
10020 
10021  /* "View.MemoryView":233
10022  * return self._shape[0]
10023  *
10024  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
10025  * return getattr(self.memview, attr)
10026  *
10027  */
10028 
10029  /* function exit code */
10030  __pyx_L1_error:;
10031  __Pyx_XDECREF(__pyx_t_1);
10032  __Pyx_XDECREF(__pyx_t_2);
10033  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10034  __pyx_r = NULL;
10035  __pyx_L0:;
10036  __Pyx_XGIVEREF(__pyx_r);
10037  __Pyx_RefNannyFinishContext();
10038  return __pyx_r;
10039 }
10040 
10041 /* "View.MemoryView":236
10042  * return getattr(self.memview, attr)
10043  *
10044  * def __getitem__(self, item): # <<<<<<<<<<<<<<
10045  * return self.memview[item]
10046  *
10047  */
10048 
10049 /* Python wrapper */
10050 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
10051 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
10052  PyObject *__pyx_r = 0;
10053  __Pyx_RefNannyDeclarations
10054  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10055  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
10056 
10057  /* function exit code */
10058  __Pyx_RefNannyFinishContext();
10059  return __pyx_r;
10060 }
10061 
10062 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
10063  PyObject *__pyx_r = NULL;
10064  __Pyx_RefNannyDeclarations
10065  PyObject *__pyx_t_1 = NULL;
10066  PyObject *__pyx_t_2 = NULL;
10067  int __pyx_lineno = 0;
10068  const char *__pyx_filename = NULL;
10069  int __pyx_clineno = 0;
10070  __Pyx_RefNannySetupContext("__getitem__", 0);
10071 
10072  /* "View.MemoryView":237
10073  *
10074  * def __getitem__(self, item):
10075  * return self.memview[item] # <<<<<<<<<<<<<<
10076  *
10077  * def __setitem__(self, item, value):
10078  */
10079  __Pyx_XDECREF(__pyx_r);
10080  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
10081  __Pyx_GOTREF(__pyx_t_1);
10082  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
10083  __Pyx_GOTREF(__pyx_t_2);
10084  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10085  __pyx_r = __pyx_t_2;
10086  __pyx_t_2 = 0;
10087  goto __pyx_L0;
10088 
10089  /* "View.MemoryView":236
10090  * return getattr(self.memview, attr)
10091  *
10092  * def __getitem__(self, item): # <<<<<<<<<<<<<<
10093  * return self.memview[item]
10094  *
10095  */
10096 
10097  /* function exit code */
10098  __pyx_L1_error:;
10099  __Pyx_XDECREF(__pyx_t_1);
10100  __Pyx_XDECREF(__pyx_t_2);
10101  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10102  __pyx_r = NULL;
10103  __pyx_L0:;
10104  __Pyx_XGIVEREF(__pyx_r);
10105  __Pyx_RefNannyFinishContext();
10106  return __pyx_r;
10107 }
10108 
10109 /* "View.MemoryView":239
10110  * return self.memview[item]
10111  *
10112  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
10113  * self.memview[item] = value
10114  *
10115  */
10116 
10117 /* Python wrapper */
10118 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
10119 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10120  int __pyx_r;
10121  __Pyx_RefNannyDeclarations
10122  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
10123  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
10124 
10125  /* function exit code */
10126  __Pyx_RefNannyFinishContext();
10127  return __pyx_r;
10128 }
10129 
10130 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10131  int __pyx_r;
10132  __Pyx_RefNannyDeclarations
10133  PyObject *__pyx_t_1 = NULL;
10134  int __pyx_lineno = 0;
10135  const char *__pyx_filename = NULL;
10136  int __pyx_clineno = 0;
10137  __Pyx_RefNannySetupContext("__setitem__", 0);
10138 
10139  /* "View.MemoryView":240
10140  *
10141  * def __setitem__(self, item, value):
10142  * self.memview[item] = value # <<<<<<<<<<<<<<
10143  *
10144  *
10145  */
10146  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
10147  __Pyx_GOTREF(__pyx_t_1);
10148  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
10149  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10150 
10151  /* "View.MemoryView":239
10152  * return self.memview[item]
10153  *
10154  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
10155  * self.memview[item] = value
10156  *
10157  */
10158 
10159  /* function exit code */
10160  __pyx_r = 0;
10161  goto __pyx_L0;
10162  __pyx_L1_error:;
10163  __Pyx_XDECREF(__pyx_t_1);
10164  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10165  __pyx_r = -1;
10166  __pyx_L0:;
10167  __Pyx_RefNannyFinishContext();
10168  return __pyx_r;
10169 }
10170 
10171 /* "(tree fragment)":1
10172  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10173  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10174  * def __setstate_cython__(self, __pyx_state):
10175  */
10176 
10177 /* Python wrapper */
10178 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10179 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10180  PyObject *__pyx_r = 0;
10181  __Pyx_RefNannyDeclarations
10182  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10183  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
10184 
10185  /* function exit code */
10186  __Pyx_RefNannyFinishContext();
10187  return __pyx_r;
10188 }
10189 
10190 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
10191  PyObject *__pyx_r = NULL;
10192  __Pyx_RefNannyDeclarations
10193  PyObject *__pyx_t_1 = NULL;
10194  int __pyx_lineno = 0;
10195  const char *__pyx_filename = NULL;
10196  int __pyx_clineno = 0;
10197  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10198 
10199  /* "(tree fragment)":2
10200  * def __reduce_cython__(self):
10201  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10202  * def __setstate_cython__(self, __pyx_state):
10203  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10204  */
10205  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10206  __Pyx_GOTREF(__pyx_t_1);
10207  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10208  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10209  __PYX_ERR(1, 2, __pyx_L1_error)
10210 
10211  /* "(tree fragment)":1
10212  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10213  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10214  * def __setstate_cython__(self, __pyx_state):
10215  */
10216 
10217  /* function exit code */
10218  __pyx_L1_error:;
10219  __Pyx_XDECREF(__pyx_t_1);
10220  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10221  __pyx_r = NULL;
10222  __Pyx_XGIVEREF(__pyx_r);
10223  __Pyx_RefNannyFinishContext();
10224  return __pyx_r;
10225 }
10226 
10227 /* "(tree fragment)":3
10228  * def __reduce_cython__(self):
10229  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10230  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10231  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10232  */
10233 
10234 /* Python wrapper */
10235 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10236 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10237  PyObject *__pyx_r = 0;
10238  __Pyx_RefNannyDeclarations
10239  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10240  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10241 
10242  /* function exit code */
10243  __Pyx_RefNannyFinishContext();
10244  return __pyx_r;
10245 }
10246 
10247 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10248  PyObject *__pyx_r = NULL;
10249  __Pyx_RefNannyDeclarations
10250  PyObject *__pyx_t_1 = NULL;
10251  int __pyx_lineno = 0;
10252  const char *__pyx_filename = NULL;
10253  int __pyx_clineno = 0;
10254  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10255 
10256  /* "(tree fragment)":4
10257  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10258  * def __setstate_cython__(self, __pyx_state):
10259  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10260  */
10261  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10262  __Pyx_GOTREF(__pyx_t_1);
10263  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10264  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10265  __PYX_ERR(1, 4, __pyx_L1_error)
10266 
10267  /* "(tree fragment)":3
10268  * def __reduce_cython__(self):
10269  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10270  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10271  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10272  */
10273 
10274  /* function exit code */
10275  __pyx_L1_error:;
10276  __Pyx_XDECREF(__pyx_t_1);
10277  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10278  __pyx_r = NULL;
10279  __Pyx_XGIVEREF(__pyx_r);
10280  __Pyx_RefNannyFinishContext();
10281  return __pyx_r;
10282 }
10283 
10284 /* "View.MemoryView":244
10285  *
10286  * @cname("__pyx_array_new")
10287  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10288  * char *mode, char *buf):
10289  * cdef array result
10290  */
10291 
10292 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
10293  struct __pyx_array_obj *__pyx_v_result = 0;
10294  struct __pyx_array_obj *__pyx_r = NULL;
10295  __Pyx_RefNannyDeclarations
10296  int __pyx_t_1;
10297  PyObject *__pyx_t_2 = NULL;
10298  PyObject *__pyx_t_3 = NULL;
10299  PyObject *__pyx_t_4 = NULL;
10300  PyObject *__pyx_t_5 = NULL;
10301  int __pyx_lineno = 0;
10302  const char *__pyx_filename = NULL;
10303  int __pyx_clineno = 0;
10304  __Pyx_RefNannySetupContext("array_cwrapper", 0);
10305 
10306  /* "View.MemoryView":248
10307  * cdef array result
10308  *
10309  * if buf == NULL: # <<<<<<<<<<<<<<
10310  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10311  * else:
10312  */
10313  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10314  if (__pyx_t_1) {
10315 
10316  /* "View.MemoryView":249
10317  *
10318  * if buf == NULL:
10319  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
10320  * else:
10321  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10322  */
10323  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
10324  __Pyx_GOTREF(__pyx_t_2);
10325  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
10326  __Pyx_GOTREF(__pyx_t_3);
10327  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10328  __Pyx_GOTREF(__pyx_t_4);
10329  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
10330  __Pyx_GOTREF(__pyx_t_5);
10331  __Pyx_INCREF(__pyx_v_shape);
10332  __Pyx_GIVEREF(__pyx_v_shape);
10333  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10334  __Pyx_GIVEREF(__pyx_t_2);
10335  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10336  __Pyx_GIVEREF(__pyx_t_3);
10337  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10338  __Pyx_GIVEREF(__pyx_t_4);
10339  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10340  __pyx_t_2 = 0;
10341  __pyx_t_3 = 0;
10342  __pyx_t_4 = 0;
10343  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10344  __Pyx_GOTREF(__pyx_t_4);
10345  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10346  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
10347  __pyx_t_4 = 0;
10348 
10349  /* "View.MemoryView":248
10350  * cdef array result
10351  *
10352  * if buf == NULL: # <<<<<<<<<<<<<<
10353  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10354  * else:
10355  */
10356  goto __pyx_L3;
10357  }
10358 
10359  /* "View.MemoryView":251
10360  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10361  * else:
10362  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10363  * allocate_buffer=False)
10364  * result.data = buf
10365  */
10366  /*else*/ {
10367  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
10368  __Pyx_GOTREF(__pyx_t_4);
10369  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10370  __Pyx_GOTREF(__pyx_t_5);
10371  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
10372  __Pyx_GOTREF(__pyx_t_3);
10373  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
10374  __Pyx_GOTREF(__pyx_t_2);
10375  __Pyx_INCREF(__pyx_v_shape);
10376  __Pyx_GIVEREF(__pyx_v_shape);
10377  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10378  __Pyx_GIVEREF(__pyx_t_4);
10379  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10380  __Pyx_GIVEREF(__pyx_t_5);
10381  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10382  __Pyx_GIVEREF(__pyx_t_3);
10383  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10384  __pyx_t_4 = 0;
10385  __pyx_t_5 = 0;
10386  __pyx_t_3 = 0;
10387 
10388  /* "View.MemoryView":252
10389  * else:
10390  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10391  * allocate_buffer=False) # <<<<<<<<<<<<<<
10392  * result.data = buf
10393  *
10394  */
10395  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
10396  __Pyx_GOTREF(__pyx_t_3);
10397  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
10398 
10399  /* "View.MemoryView":251
10400  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10401  * else:
10402  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10403  * allocate_buffer=False)
10404  * result.data = buf
10405  */
10406  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10407  __Pyx_GOTREF(__pyx_t_5);
10408  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10409  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10410  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
10411  __pyx_t_5 = 0;
10412 
10413  /* "View.MemoryView":253
10414  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10415  * allocate_buffer=False)
10416  * result.data = buf # <<<<<<<<<<<<<<
10417  *
10418  * return result
10419  */
10420  __pyx_v_result->data = __pyx_v_buf;
10421  }
10422  __pyx_L3:;
10423 
10424  /* "View.MemoryView":255
10425  * result.data = buf
10426  *
10427  * return result # <<<<<<<<<<<<<<
10428  *
10429  *
10430  */
10431  __Pyx_XDECREF(((PyObject *)__pyx_r));
10432  __Pyx_INCREF(((PyObject *)__pyx_v_result));
10433  __pyx_r = __pyx_v_result;
10434  goto __pyx_L0;
10435 
10436  /* "View.MemoryView":244
10437  *
10438  * @cname("__pyx_array_new")
10439  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10440  * char *mode, char *buf):
10441  * cdef array result
10442  */
10443 
10444  /* function exit code */
10445  __pyx_L1_error:;
10446  __Pyx_XDECREF(__pyx_t_2);
10447  __Pyx_XDECREF(__pyx_t_3);
10448  __Pyx_XDECREF(__pyx_t_4);
10449  __Pyx_XDECREF(__pyx_t_5);
10450  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10451  __pyx_r = 0;
10452  __pyx_L0:;
10453  __Pyx_XDECREF((PyObject *)__pyx_v_result);
10454  __Pyx_XGIVEREF((PyObject *)__pyx_r);
10455  __Pyx_RefNannyFinishContext();
10456  return __pyx_r;
10457 }
10458 
10459 /* "View.MemoryView":281
10460  * cdef class Enum(object):
10461  * cdef object name
10462  * def __init__(self, name): # <<<<<<<<<<<<<<
10463  * self.name = name
10464  * def __repr__(self):
10465  */
10466 
10467 /* Python wrapper */
10468 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10469 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10470  PyObject *__pyx_v_name = 0;
10471  int __pyx_lineno = 0;
10472  const char *__pyx_filename = NULL;
10473  int __pyx_clineno = 0;
10474  int __pyx_r;
10475  __Pyx_RefNannyDeclarations
10476  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
10477  {
10478  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10479  PyObject* values[1] = {0};
10480  if (unlikely(__pyx_kwds)) {
10481  Py_ssize_t kw_args;
10482  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10483  switch (pos_args) {
10484  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10485  CYTHON_FALLTHROUGH;
10486  case 0: break;
10487  default: goto __pyx_L5_argtuple_error;
10488  }
10489  kw_args = PyDict_Size(__pyx_kwds);
10490  switch (pos_args) {
10491  case 0:
10492  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10493  else goto __pyx_L5_argtuple_error;
10494  }
10495  if (unlikely(kw_args > 0)) {
10496  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
10497  }
10498  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10499  goto __pyx_L5_argtuple_error;
10500  } else {
10501  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10502  }
10503  __pyx_v_name = values[0];
10504  }
10505  goto __pyx_L4_argument_unpacking_done;
10506  __pyx_L5_argtuple_error:;
10507  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
10508  __pyx_L3_error:;
10509  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10510  __Pyx_RefNannyFinishContext();
10511  return -1;
10512  __pyx_L4_argument_unpacking_done:;
10513  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10514 
10515  /* function exit code */
10516  __Pyx_RefNannyFinishContext();
10517  return __pyx_r;
10518 }
10519 
10520 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10521  int __pyx_r;
10522  __Pyx_RefNannyDeclarations
10523  __Pyx_RefNannySetupContext("__init__", 0);
10524 
10525  /* "View.MemoryView":282
10526  * cdef object name
10527  * def __init__(self, name):
10528  * self.name = name # <<<<<<<<<<<<<<
10529  * def __repr__(self):
10530  * return self.name
10531  */
10532  __Pyx_INCREF(__pyx_v_name);
10533  __Pyx_GIVEREF(__pyx_v_name);
10534  __Pyx_GOTREF(__pyx_v_self->name);
10535  __Pyx_DECREF(__pyx_v_self->name);
10536  __pyx_v_self->name = __pyx_v_name;
10537 
10538  /* "View.MemoryView":281
10539  * cdef class Enum(object):
10540  * cdef object name
10541  * def __init__(self, name): # <<<<<<<<<<<<<<
10542  * self.name = name
10543  * def __repr__(self):
10544  */
10545 
10546  /* function exit code */
10547  __pyx_r = 0;
10548  __Pyx_RefNannyFinishContext();
10549  return __pyx_r;
10550 }
10551 
10552 /* "View.MemoryView":283
10553  * def __init__(self, name):
10554  * self.name = name
10555  * def __repr__(self): # <<<<<<<<<<<<<<
10556  * return self.name
10557  *
10558  */
10559 
10560 /* Python wrapper */
10561 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
10562 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10563  PyObject *__pyx_r = 0;
10564  __Pyx_RefNannyDeclarations
10565  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10566  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10567 
10568  /* function exit code */
10569  __Pyx_RefNannyFinishContext();
10570  return __pyx_r;
10571 }
10572 
10573 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10574  PyObject *__pyx_r = NULL;
10575  __Pyx_RefNannyDeclarations
10576  __Pyx_RefNannySetupContext("__repr__", 0);
10577 
10578  /* "View.MemoryView":284
10579  * self.name = name
10580  * def __repr__(self):
10581  * return self.name # <<<<<<<<<<<<<<
10582  *
10583  * cdef generic = Enum("<strided and direct or indirect>")
10584  */
10585  __Pyx_XDECREF(__pyx_r);
10586  __Pyx_INCREF(__pyx_v_self->name);
10587  __pyx_r = __pyx_v_self->name;
10588  goto __pyx_L0;
10589 
10590  /* "View.MemoryView":283
10591  * def __init__(self, name):
10592  * self.name = name
10593  * def __repr__(self): # <<<<<<<<<<<<<<
10594  * return self.name
10595  *
10596  */
10597 
10598  /* function exit code */
10599  __pyx_L0:;
10600  __Pyx_XGIVEREF(__pyx_r);
10601  __Pyx_RefNannyFinishContext();
10602  return __pyx_r;
10603 }
10604 
10605 /* "(tree fragment)":1
10606  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10607  * cdef tuple state
10608  * cdef object _dict
10609  */
10610 
10611 /* Python wrapper */
10612 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10613 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10614  PyObject *__pyx_r = 0;
10615  __Pyx_RefNannyDeclarations
10616  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10617  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10618 
10619  /* function exit code */
10620  __Pyx_RefNannyFinishContext();
10621  return __pyx_r;
10622 }
10623 
10624 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10625  PyObject *__pyx_v_state = 0;
10626  PyObject *__pyx_v__dict = 0;
10627  int __pyx_v_use_setstate;
10628  PyObject *__pyx_r = NULL;
10629  __Pyx_RefNannyDeclarations
10630  PyObject *__pyx_t_1 = NULL;
10631  int __pyx_t_2;
10632  int __pyx_t_3;
10633  PyObject *__pyx_t_4 = NULL;
10634  PyObject *__pyx_t_5 = NULL;
10635  int __pyx_lineno = 0;
10636  const char *__pyx_filename = NULL;
10637  int __pyx_clineno = 0;
10638  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10639 
10640  /* "(tree fragment)":5
10641  * cdef object _dict
10642  * cdef bint use_setstate
10643  * state = (self.name,) # <<<<<<<<<<<<<<
10644  * _dict = getattr(self, '__dict__', None)
10645  * if _dict is not None:
10646  */
10647  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
10648  __Pyx_GOTREF(__pyx_t_1);
10649  __Pyx_INCREF(__pyx_v_self->name);
10650  __Pyx_GIVEREF(__pyx_v_self->name);
10651  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10652  __pyx_v_state = ((PyObject*)__pyx_t_1);
10653  __pyx_t_1 = 0;
10654 
10655  /* "(tree fragment)":6
10656  * cdef bint use_setstate
10657  * state = (self.name,)
10658  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
10659  * if _dict is not None:
10660  * state += (_dict,)
10661  */
10662  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10663  __Pyx_GOTREF(__pyx_t_1);
10664  __pyx_v__dict = __pyx_t_1;
10665  __pyx_t_1 = 0;
10666 
10667  /* "(tree fragment)":7
10668  * state = (self.name,)
10669  * _dict = getattr(self, '__dict__', None)
10670  * if _dict is not None: # <<<<<<<<<<<<<<
10671  * state += (_dict,)
10672  * use_setstate = True
10673  */
10674  __pyx_t_2 = (__pyx_v__dict != Py_None);
10675  __pyx_t_3 = (__pyx_t_2 != 0);
10676  if (__pyx_t_3) {
10677 
10678  /* "(tree fragment)":8
10679  * _dict = getattr(self, '__dict__', None)
10680  * if _dict is not None:
10681  * state += (_dict,) # <<<<<<<<<<<<<<
10682  * use_setstate = True
10683  * else:
10684  */
10685  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
10686  __Pyx_GOTREF(__pyx_t_1);
10687  __Pyx_INCREF(__pyx_v__dict);
10688  __Pyx_GIVEREF(__pyx_v__dict);
10689  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10690  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
10691  __Pyx_GOTREF(__pyx_t_4);
10692  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10693  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10694  __pyx_t_4 = 0;
10695 
10696  /* "(tree fragment)":9
10697  * if _dict is not None:
10698  * state += (_dict,)
10699  * use_setstate = True # <<<<<<<<<<<<<<
10700  * else:
10701  * use_setstate = self.name is not None
10702  */
10703  __pyx_v_use_setstate = 1;
10704 
10705  /* "(tree fragment)":7
10706  * state = (self.name,)
10707  * _dict = getattr(self, '__dict__', None)
10708  * if _dict is not None: # <<<<<<<<<<<<<<
10709  * state += (_dict,)
10710  * use_setstate = True
10711  */
10712  goto __pyx_L3;
10713  }
10714 
10715  /* "(tree fragment)":11
10716  * use_setstate = True
10717  * else:
10718  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
10719  * if use_setstate:
10720  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10721  */
10722  /*else*/ {
10723  __pyx_t_3 = (__pyx_v_self->name != Py_None);
10724  __pyx_v_use_setstate = __pyx_t_3;
10725  }
10726  __pyx_L3:;
10727 
10728  /* "(tree fragment)":12
10729  * else:
10730  * use_setstate = self.name is not None
10731  * if use_setstate: # <<<<<<<<<<<<<<
10732  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10733  * else:
10734  */
10735  __pyx_t_3 = (__pyx_v_use_setstate != 0);
10736  if (__pyx_t_3) {
10737 
10738  /* "(tree fragment)":13
10739  * use_setstate = self.name is not None
10740  * if use_setstate:
10741  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
10742  * else:
10743  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10744  */
10745  __Pyx_XDECREF(__pyx_r);
10746  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10747  __Pyx_GOTREF(__pyx_t_4);
10748  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10749  __Pyx_GOTREF(__pyx_t_1);
10750  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10751  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10752  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10753  __Pyx_INCREF(__pyx_int_184977713);
10754  __Pyx_GIVEREF(__pyx_int_184977713);
10755  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10756  __Pyx_INCREF(Py_None);
10757  __Pyx_GIVEREF(Py_None);
10758  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10759  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10760  __Pyx_GOTREF(__pyx_t_5);
10761  __Pyx_GIVEREF(__pyx_t_4);
10762  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10763  __Pyx_GIVEREF(__pyx_t_1);
10764  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10765  __Pyx_INCREF(__pyx_v_state);
10766  __Pyx_GIVEREF(__pyx_v_state);
10767  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10768  __pyx_t_4 = 0;
10769  __pyx_t_1 = 0;
10770  __pyx_r = __pyx_t_5;
10771  __pyx_t_5 = 0;
10772  goto __pyx_L0;
10773 
10774  /* "(tree fragment)":12
10775  * else:
10776  * use_setstate = self.name is not None
10777  * if use_setstate: # <<<<<<<<<<<<<<
10778  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10779  * else:
10780  */
10781  }
10782 
10783  /* "(tree fragment)":15
10784  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10785  * else:
10786  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
10787  * def __setstate_cython__(self, __pyx_state):
10788  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10789  */
10790  /*else*/ {
10791  __Pyx_XDECREF(__pyx_r);
10792  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
10793  __Pyx_GOTREF(__pyx_t_5);
10794  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10795  __Pyx_GOTREF(__pyx_t_1);
10796  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10797  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10798  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10799  __Pyx_INCREF(__pyx_int_184977713);
10800  __Pyx_GIVEREF(__pyx_int_184977713);
10801  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10802  __Pyx_INCREF(__pyx_v_state);
10803  __Pyx_GIVEREF(__pyx_v_state);
10804  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10805  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
10806  __Pyx_GOTREF(__pyx_t_4);
10807  __Pyx_GIVEREF(__pyx_t_5);
10808  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10809  __Pyx_GIVEREF(__pyx_t_1);
10810  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10811  __pyx_t_5 = 0;
10812  __pyx_t_1 = 0;
10813  __pyx_r = __pyx_t_4;
10814  __pyx_t_4 = 0;
10815  goto __pyx_L0;
10816  }
10817 
10818  /* "(tree fragment)":1
10819  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10820  * cdef tuple state
10821  * cdef object _dict
10822  */
10823 
10824  /* function exit code */
10825  __pyx_L1_error:;
10826  __Pyx_XDECREF(__pyx_t_1);
10827  __Pyx_XDECREF(__pyx_t_4);
10828  __Pyx_XDECREF(__pyx_t_5);
10829  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10830  __pyx_r = NULL;
10831  __pyx_L0:;
10832  __Pyx_XDECREF(__pyx_v_state);
10833  __Pyx_XDECREF(__pyx_v__dict);
10834  __Pyx_XGIVEREF(__pyx_r);
10835  __Pyx_RefNannyFinishContext();
10836  return __pyx_r;
10837 }
10838 
10839 /* "(tree fragment)":16
10840  * else:
10841  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10842  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10843  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10844  */
10845 
10846 /* Python wrapper */
10847 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10848 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10849  PyObject *__pyx_r = 0;
10850  __Pyx_RefNannyDeclarations
10851  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10852  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10853 
10854  /* function exit code */
10855  __Pyx_RefNannyFinishContext();
10856  return __pyx_r;
10857 }
10858 
10859 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10860  PyObject *__pyx_r = NULL;
10861  __Pyx_RefNannyDeclarations
10862  PyObject *__pyx_t_1 = NULL;
10863  int __pyx_lineno = 0;
10864  const char *__pyx_filename = NULL;
10865  int __pyx_clineno = 0;
10866  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10867 
10868  /* "(tree fragment)":17
10869  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10870  * def __setstate_cython__(self, __pyx_state):
10871  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10872  */
10873  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
10874  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
10875  __Pyx_GOTREF(__pyx_t_1);
10876  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10877 
10878  /* "(tree fragment)":16
10879  * else:
10880  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10881  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10882  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10883  */
10884 
10885  /* function exit code */
10886  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10887  goto __pyx_L0;
10888  __pyx_L1_error:;
10889  __Pyx_XDECREF(__pyx_t_1);
10890  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10891  __pyx_r = NULL;
10892  __pyx_L0:;
10893  __Pyx_XGIVEREF(__pyx_r);
10894  __Pyx_RefNannyFinishContext();
10895  return __pyx_r;
10896 }
10897 
10898 /* "View.MemoryView":298
10899  *
10900  * @cname('__pyx_align_pointer')
10901  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10902  * "Align pointer memory on a given boundary"
10903  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10904  */
10905 
10906 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10907  Py_intptr_t __pyx_v_aligned_p;
10908  size_t __pyx_v_offset;
10909  void *__pyx_r;
10910  int __pyx_t_1;
10911 
10912  /* "View.MemoryView":300
10913  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10914  * "Align pointer memory on a given boundary"
10915  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10916  * cdef size_t offset
10917  *
10918  */
10919  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10920 
10921  /* "View.MemoryView":304
10922  *
10923  * with cython.cdivision(True):
10924  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10925  *
10926  * if offset > 0:
10927  */
10928  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10929 
10930  /* "View.MemoryView":306
10931  * offset = aligned_p % alignment
10932  *
10933  * if offset > 0: # <<<<<<<<<<<<<<
10934  * aligned_p += alignment - offset
10935  *
10936  */
10937  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10938  if (__pyx_t_1) {
10939 
10940  /* "View.MemoryView":307
10941  *
10942  * if offset > 0:
10943  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10944  *
10945  * return <void *> aligned_p
10946  */
10947  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10948 
10949  /* "View.MemoryView":306
10950  * offset = aligned_p % alignment
10951  *
10952  * if offset > 0: # <<<<<<<<<<<<<<
10953  * aligned_p += alignment - offset
10954  *
10955  */
10956  }
10957 
10958  /* "View.MemoryView":309
10959  * aligned_p += alignment - offset
10960  *
10961  * return <void *> aligned_p # <<<<<<<<<<<<<<
10962  *
10963  *
10964  */
10965  __pyx_r = ((void *)__pyx_v_aligned_p);
10966  goto __pyx_L0;
10967 
10968  /* "View.MemoryView":298
10969  *
10970  * @cname('__pyx_align_pointer')
10971  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10972  * "Align pointer memory on a given boundary"
10973  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10974  */
10975 
10976  /* function exit code */
10977  __pyx_L0:;
10978  return __pyx_r;
10979 }
10980 
10981 /* "View.MemoryView":345
10982  * cdef __Pyx_TypeInfo *typeinfo
10983  *
10984  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10985  * self.obj = obj
10986  * self.flags = flags
10987  */
10988 
10989 /* Python wrapper */
10990 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10991 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10992  PyObject *__pyx_v_obj = 0;
10993  int __pyx_v_flags;
10994  int __pyx_v_dtype_is_object;
10995  int __pyx_lineno = 0;
10996  const char *__pyx_filename = NULL;
10997  int __pyx_clineno = 0;
10998  int __pyx_r;
10999  __Pyx_RefNannyDeclarations
11000  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
11001  {
11002  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
11003  PyObject* values[3] = {0,0,0};
11004  if (unlikely(__pyx_kwds)) {
11005  Py_ssize_t kw_args;
11006  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11007  switch (pos_args) {
11008  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11009  CYTHON_FALLTHROUGH;
11010  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11011  CYTHON_FALLTHROUGH;
11012  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11013  CYTHON_FALLTHROUGH;
11014  case 0: break;
11015  default: goto __pyx_L5_argtuple_error;
11016  }
11017  kw_args = PyDict_Size(__pyx_kwds);
11018  switch (pos_args) {
11019  case 0:
11020  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
11021  else goto __pyx_L5_argtuple_error;
11022  CYTHON_FALLTHROUGH;
11023  case 1:
11024  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
11025  else {
11026  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
11027  }
11028  CYTHON_FALLTHROUGH;
11029  case 2:
11030  if (kw_args > 0) {
11031  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
11032  if (value) { values[2] = value; kw_args--; }
11033  }
11034  }
11035  if (unlikely(kw_args > 0)) {
11036  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
11037  }
11038  } else {
11039  switch (PyTuple_GET_SIZE(__pyx_args)) {
11040  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11041  CYTHON_FALLTHROUGH;
11042  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11043  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11044  break;
11045  default: goto __pyx_L5_argtuple_error;
11046  }
11047  }
11048  __pyx_v_obj = values[0];
11049  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
11050  if (values[2]) {
11051  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
11052  } else {
11053  __pyx_v_dtype_is_object = ((int)0);
11054  }
11055  }
11056  goto __pyx_L4_argument_unpacking_done;
11057  __pyx_L5_argtuple_error:;
11058  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
11059  __pyx_L3_error:;
11060  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11061  __Pyx_RefNannyFinishContext();
11062  return -1;
11063  __pyx_L4_argument_unpacking_done:;
11064  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
11065 
11066  /* function exit code */
11067  __Pyx_RefNannyFinishContext();
11068  return __pyx_r;
11069 }
11070 
11071 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
11072  int __pyx_r;
11073  __Pyx_RefNannyDeclarations
11074  int __pyx_t_1;
11075  int __pyx_t_2;
11076  int __pyx_t_3;
11077  int __pyx_t_4;
11078  int __pyx_lineno = 0;
11079  const char *__pyx_filename = NULL;
11080  int __pyx_clineno = 0;
11081  __Pyx_RefNannySetupContext("__cinit__", 0);
11082 
11083  /* "View.MemoryView":346
11084  *
11085  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
11086  * self.obj = obj # <<<<<<<<<<<<<<
11087  * self.flags = flags
11088  * if type(self) is memoryview or obj is not None:
11089  */
11090  __Pyx_INCREF(__pyx_v_obj);
11091  __Pyx_GIVEREF(__pyx_v_obj);
11092  __Pyx_GOTREF(__pyx_v_self->obj);
11093  __Pyx_DECREF(__pyx_v_self->obj);
11094  __pyx_v_self->obj = __pyx_v_obj;
11095 
11096  /* "View.MemoryView":347
11097  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
11098  * self.obj = obj
11099  * self.flags = flags # <<<<<<<<<<<<<<
11100  * if type(self) is memoryview or obj is not None:
11101  * __Pyx_GetBuffer(obj, &self.view, flags)
11102  */
11103  __pyx_v_self->flags = __pyx_v_flags;
11104 
11105  /* "View.MemoryView":348
11106  * self.obj = obj
11107  * self.flags = flags
11108  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
11109  * __Pyx_GetBuffer(obj, &self.view, flags)
11110  * if <PyObject *> self.view.obj == NULL:
11111  */
11112  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
11113  __pyx_t_3 = (__pyx_t_2 != 0);
11114  if (!__pyx_t_3) {
11115  } else {
11116  __pyx_t_1 = __pyx_t_3;
11117  goto __pyx_L4_bool_binop_done;
11118  }
11119  __pyx_t_3 = (__pyx_v_obj != Py_None);
11120  __pyx_t_2 = (__pyx_t_3 != 0);
11121  __pyx_t_1 = __pyx_t_2;
11122  __pyx_L4_bool_binop_done:;
11123  if (__pyx_t_1) {
11124 
11125  /* "View.MemoryView":349
11126  * self.flags = flags
11127  * if type(self) is memoryview or obj is not None:
11128  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
11129  * if <PyObject *> self.view.obj == NULL:
11130  * (<__pyx_buffer *> &self.view).obj = Py_None
11131  */
11132  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
11133 
11134  /* "View.MemoryView":350
11135  * if type(self) is memoryview or obj is not None:
11136  * __Pyx_GetBuffer(obj, &self.view, flags)
11137  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
11138  * (<__pyx_buffer *> &self.view).obj = Py_None
11139  * Py_INCREF(Py_None)
11140  */
11141  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
11142  if (__pyx_t_1) {
11143 
11144  /* "View.MemoryView":351
11145  * __Pyx_GetBuffer(obj, &self.view, flags)
11146  * if <PyObject *> self.view.obj == NULL:
11147  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
11148  * Py_INCREF(Py_None)
11149  *
11150  */
11151  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
11152 
11153  /* "View.MemoryView":352
11154  * if <PyObject *> self.view.obj == NULL:
11155  * (<__pyx_buffer *> &self.view).obj = Py_None
11156  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
11157  *
11158  * global __pyx_memoryview_thread_locks_used
11159  */
11160  Py_INCREF(Py_None);
11161 
11162  /* "View.MemoryView":350
11163  * if type(self) is memoryview or obj is not None:
11164  * __Pyx_GetBuffer(obj, &self.view, flags)
11165  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
11166  * (<__pyx_buffer *> &self.view).obj = Py_None
11167  * Py_INCREF(Py_None)
11168  */
11169  }
11170 
11171  /* "View.MemoryView":348
11172  * self.obj = obj
11173  * self.flags = flags
11174  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
11175  * __Pyx_GetBuffer(obj, &self.view, flags)
11176  * if <PyObject *> self.view.obj == NULL:
11177  */
11178  }
11179 
11180  /* "View.MemoryView":355
11181  *
11182  * global __pyx_memoryview_thread_locks_used
11183  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11184  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11185  * __pyx_memoryview_thread_locks_used += 1
11186  */
11187  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
11188  if (__pyx_t_1) {
11189 
11190  /* "View.MemoryView":356
11191  * global __pyx_memoryview_thread_locks_used
11192  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
11193  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
11194  * __pyx_memoryview_thread_locks_used += 1
11195  * if self.lock is NULL:
11196  */
11197  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11198 
11199  /* "View.MemoryView":357
11200  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
11201  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11202  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
11203  * if self.lock is NULL:
11204  * self.lock = PyThread_allocate_lock()
11205  */
11206  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
11207 
11208  /* "View.MemoryView":355
11209  *
11210  * global __pyx_memoryview_thread_locks_used
11211  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11212  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11213  * __pyx_memoryview_thread_locks_used += 1
11214  */
11215  }
11216 
11217  /* "View.MemoryView":358
11218  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11219  * __pyx_memoryview_thread_locks_used += 1
11220  * if self.lock is NULL: # <<<<<<<<<<<<<<
11221  * self.lock = PyThread_allocate_lock()
11222  * if self.lock is NULL:
11223  */
11224  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11225  if (__pyx_t_1) {
11226 
11227  /* "View.MemoryView":359
11228  * __pyx_memoryview_thread_locks_used += 1
11229  * if self.lock is NULL:
11230  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
11231  * if self.lock is NULL:
11232  * raise MemoryError
11233  */
11234  __pyx_v_self->lock = PyThread_allocate_lock();
11235 
11236  /* "View.MemoryView":360
11237  * if self.lock is NULL:
11238  * self.lock = PyThread_allocate_lock()
11239  * if self.lock is NULL: # <<<<<<<<<<<<<<
11240  * raise MemoryError
11241  *
11242  */
11243  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11244  if (unlikely(__pyx_t_1)) {
11245 
11246  /* "View.MemoryView":361
11247  * self.lock = PyThread_allocate_lock()
11248  * if self.lock is NULL:
11249  * raise MemoryError # <<<<<<<<<<<<<<
11250  *
11251  * if flags & PyBUF_FORMAT:
11252  */
11253  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
11254 
11255  /* "View.MemoryView":360
11256  * if self.lock is NULL:
11257  * self.lock = PyThread_allocate_lock()
11258  * if self.lock is NULL: # <<<<<<<<<<<<<<
11259  * raise MemoryError
11260  *
11261  */
11262  }
11263 
11264  /* "View.MemoryView":358
11265  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11266  * __pyx_memoryview_thread_locks_used += 1
11267  * if self.lock is NULL: # <<<<<<<<<<<<<<
11268  * self.lock = PyThread_allocate_lock()
11269  * if self.lock is NULL:
11270  */
11271  }
11272 
11273  /* "View.MemoryView":363
11274  * raise MemoryError
11275  *
11276  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11277  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11278  * else:
11279  */
11280  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11281  if (__pyx_t_1) {
11282 
11283  /* "View.MemoryView":364
11284  *
11285  * if flags & PyBUF_FORMAT:
11286  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
11287  * else:
11288  * self.dtype_is_object = dtype_is_object
11289  */
11290  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
11291  if (__pyx_t_2) {
11292  } else {
11293  __pyx_t_1 = __pyx_t_2;
11294  goto __pyx_L11_bool_binop_done;
11295  }
11296  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
11297  __pyx_t_1 = __pyx_t_2;
11298  __pyx_L11_bool_binop_done:;
11299  __pyx_v_self->dtype_is_object = __pyx_t_1;
11300 
11301  /* "View.MemoryView":363
11302  * raise MemoryError
11303  *
11304  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11305  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11306  * else:
11307  */
11308  goto __pyx_L10;
11309  }
11310 
11311  /* "View.MemoryView":366
11312  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11313  * else:
11314  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
11315  *
11316  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11317  */
11318  /*else*/ {
11319  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11320  }
11321  __pyx_L10:;
11322 
11323  /* "View.MemoryView":368
11324  * self.dtype_is_object = dtype_is_object
11325  *
11326  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
11327  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11328  * self.typeinfo = NULL
11329  */
11330  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
11331 
11332  /* "View.MemoryView":370
11333  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11334  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11335  * self.typeinfo = NULL # <<<<<<<<<<<<<<
11336  *
11337  * def __dealloc__(memoryview self):
11338  */
11339  __pyx_v_self->typeinfo = NULL;
11340 
11341  /* "View.MemoryView":345
11342  * cdef __Pyx_TypeInfo *typeinfo
11343  *
11344  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11345  * self.obj = obj
11346  * self.flags = flags
11347  */
11348 
11349  /* function exit code */
11350  __pyx_r = 0;
11351  goto __pyx_L0;
11352  __pyx_L1_error:;
11353  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11354  __pyx_r = -1;
11355  __pyx_L0:;
11356  __Pyx_RefNannyFinishContext();
11357  return __pyx_r;
11358 }
11359 
11360 /* "View.MemoryView":372
11361  * self.typeinfo = NULL
11362  *
11363  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11364  * if self.obj is not None:
11365  * __Pyx_ReleaseBuffer(&self.view)
11366  */
11367 
11368 /* Python wrapper */
11369 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
11370 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11371  __Pyx_RefNannyDeclarations
11372  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
11373  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11374 
11375  /* function exit code */
11376  __Pyx_RefNannyFinishContext();
11377 }
11378 
11379 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
11380  int __pyx_v_i;
11381  __Pyx_RefNannyDeclarations
11382  int __pyx_t_1;
11383  int __pyx_t_2;
11384  int __pyx_t_3;
11385  int __pyx_t_4;
11386  int __pyx_t_5;
11387  PyThread_type_lock __pyx_t_6;
11388  PyThread_type_lock __pyx_t_7;
11389  __Pyx_RefNannySetupContext("__dealloc__", 0);
11390 
11391  /* "View.MemoryView":373
11392  *
11393  * def __dealloc__(memoryview self):
11394  * if self.obj is not None: # <<<<<<<<<<<<<<
11395  * __Pyx_ReleaseBuffer(&self.view)
11396  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11397  */
11398  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11399  __pyx_t_2 = (__pyx_t_1 != 0);
11400  if (__pyx_t_2) {
11401 
11402  /* "View.MemoryView":374
11403  * def __dealloc__(memoryview self):
11404  * if self.obj is not None:
11405  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
11406  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11407  *
11408  */
11409  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11410 
11411  /* "View.MemoryView":373
11412  *
11413  * def __dealloc__(memoryview self):
11414  * if self.obj is not None: # <<<<<<<<<<<<<<
11415  * __Pyx_ReleaseBuffer(&self.view)
11416  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11417  */
11418  goto __pyx_L3;
11419  }
11420 
11421  /* "View.MemoryView":375
11422  * if self.obj is not None:
11423  * __Pyx_ReleaseBuffer(&self.view)
11424  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11425  *
11426  * (<__pyx_buffer *> &self.view).obj = NULL
11427  */
11428  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
11429  if (__pyx_t_2) {
11430 
11431  /* "View.MemoryView":377
11432  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11433  *
11434  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
11435  * Py_DECREF(Py_None)
11436  *
11437  */
11438  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
11439 
11440  /* "View.MemoryView":378
11441  *
11442  * (<__pyx_buffer *> &self.view).obj = NULL
11443  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
11444  *
11445  * cdef int i
11446  */
11447  Py_DECREF(Py_None);
11448 
11449  /* "View.MemoryView":375
11450  * if self.obj is not None:
11451  * __Pyx_ReleaseBuffer(&self.view)
11452  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11453  *
11454  * (<__pyx_buffer *> &self.view).obj = NULL
11455  */
11456  }
11457  __pyx_L3:;
11458 
11459  /* "View.MemoryView":382
11460  * cdef int i
11461  * global __pyx_memoryview_thread_locks_used
11462  * if self.lock != NULL: # <<<<<<<<<<<<<<
11463  * for i in range(__pyx_memoryview_thread_locks_used):
11464  * if __pyx_memoryview_thread_locks[i] is self.lock:
11465  */
11466  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11467  if (__pyx_t_2) {
11468 
11469  /* "View.MemoryView":383
11470  * global __pyx_memoryview_thread_locks_used
11471  * if self.lock != NULL:
11472  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
11473  * if __pyx_memoryview_thread_locks[i] is self.lock:
11474  * __pyx_memoryview_thread_locks_used -= 1
11475  */
11476  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11477  __pyx_t_4 = __pyx_t_3;
11478  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11479  __pyx_v_i = __pyx_t_5;
11480 
11481  /* "View.MemoryView":384
11482  * if self.lock != NULL:
11483  * for i in range(__pyx_memoryview_thread_locks_used):
11484  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11485  * __pyx_memoryview_thread_locks_used -= 1
11486  * if i != __pyx_memoryview_thread_locks_used:
11487  */
11488  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11489  if (__pyx_t_2) {
11490 
11491  /* "View.MemoryView":385
11492  * for i in range(__pyx_memoryview_thread_locks_used):
11493  * if __pyx_memoryview_thread_locks[i] is self.lock:
11494  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
11495  * if i != __pyx_memoryview_thread_locks_used:
11496  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11497  */
11498  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11499 
11500  /* "View.MemoryView":386
11501  * if __pyx_memoryview_thread_locks[i] is self.lock:
11502  * __pyx_memoryview_thread_locks_used -= 1
11503  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11504  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11505  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11506  */
11507  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11508  if (__pyx_t_2) {
11509 
11510  /* "View.MemoryView":388
11511  * if i != __pyx_memoryview_thread_locks_used:
11512  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11513  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
11514  * break
11515  * else:
11516  */
11517  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11518  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11519 
11520  /* "View.MemoryView":387
11521  * __pyx_memoryview_thread_locks_used -= 1
11522  * if i != __pyx_memoryview_thread_locks_used:
11523  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
11524  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11525  * break
11526  */
11527  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11528  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11529 
11530  /* "View.MemoryView":386
11531  * if __pyx_memoryview_thread_locks[i] is self.lock:
11532  * __pyx_memoryview_thread_locks_used -= 1
11533  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11534  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11535  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11536  */
11537  }
11538 
11539  /* "View.MemoryView":389
11540  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11541  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11542  * break # <<<<<<<<<<<<<<
11543  * else:
11544  * PyThread_free_lock(self.lock)
11545  */
11546  goto __pyx_L6_break;
11547 
11548  /* "View.MemoryView":384
11549  * if self.lock != NULL:
11550  * for i in range(__pyx_memoryview_thread_locks_used):
11551  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11552  * __pyx_memoryview_thread_locks_used -= 1
11553  * if i != __pyx_memoryview_thread_locks_used:
11554  */
11555  }
11556  }
11557  /*else*/ {
11558 
11559  /* "View.MemoryView":391
11560  * break
11561  * else:
11562  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
11563  *
11564  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11565  */
11566  PyThread_free_lock(__pyx_v_self->lock);
11567  }
11568  __pyx_L6_break:;
11569 
11570  /* "View.MemoryView":382
11571  * cdef int i
11572  * global __pyx_memoryview_thread_locks_used
11573  * if self.lock != NULL: # <<<<<<<<<<<<<<
11574  * for i in range(__pyx_memoryview_thread_locks_used):
11575  * if __pyx_memoryview_thread_locks[i] is self.lock:
11576  */
11577  }
11578 
11579  /* "View.MemoryView":372
11580  * self.typeinfo = NULL
11581  *
11582  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11583  * if self.obj is not None:
11584  * __Pyx_ReleaseBuffer(&self.view)
11585  */
11586 
11587  /* function exit code */
11588  __Pyx_RefNannyFinishContext();
11589 }
11590 
11591 /* "View.MemoryView":393
11592  * PyThread_free_lock(self.lock)
11593  *
11594  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11595  * cdef Py_ssize_t dim
11596  * cdef char *itemp = <char *> self.view.buf
11597  */
11598 
11599 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11600  Py_ssize_t __pyx_v_dim;
11601  char *__pyx_v_itemp;
11602  PyObject *__pyx_v_idx = NULL;
11603  char *__pyx_r;
11604  __Pyx_RefNannyDeclarations
11605  Py_ssize_t __pyx_t_1;
11606  PyObject *__pyx_t_2 = NULL;
11607  Py_ssize_t __pyx_t_3;
11608  PyObject *(*__pyx_t_4)(PyObject *);
11609  PyObject *__pyx_t_5 = NULL;
11610  Py_ssize_t __pyx_t_6;
11611  char *__pyx_t_7;
11612  int __pyx_lineno = 0;
11613  const char *__pyx_filename = NULL;
11614  int __pyx_clineno = 0;
11615  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11616 
11617  /* "View.MemoryView":395
11618  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11619  * cdef Py_ssize_t dim
11620  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11621  *
11622  * for dim, idx in enumerate(index):
11623  */
11624  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11625 
11626  /* "View.MemoryView":397
11627  * cdef char *itemp = <char *> self.view.buf
11628  *
11629  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11630  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11631  *
11632  */
11633  __pyx_t_1 = 0;
11634  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11635  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11636  __pyx_t_4 = NULL;
11637  } else {
11638  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
11639  __Pyx_GOTREF(__pyx_t_2);
11640  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
11641  }
11642  for (;;) {
11643  if (likely(!__pyx_t_4)) {
11644  if (likely(PyList_CheckExact(__pyx_t_2))) {
11645  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11646  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11647  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11648  #else
11649  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11650  __Pyx_GOTREF(__pyx_t_5);
11651  #endif
11652  } else {
11653  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11654  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11655  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11656  #else
11657  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11658  __Pyx_GOTREF(__pyx_t_5);
11659  #endif
11660  }
11661  } else {
11662  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11663  if (unlikely(!__pyx_t_5)) {
11664  PyObject* exc_type = PyErr_Occurred();
11665  if (exc_type) {
11666  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11667  else __PYX_ERR(1, 397, __pyx_L1_error)
11668  }
11669  break;
11670  }
11671  __Pyx_GOTREF(__pyx_t_5);
11672  }
11673  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11674  __pyx_t_5 = 0;
11675  __pyx_v_dim = __pyx_t_1;
11676  __pyx_t_1 = (__pyx_t_1 + 1);
11677 
11678  /* "View.MemoryView":398
11679  *
11680  * for dim, idx in enumerate(index):
11681  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
11682  *
11683  * return itemp
11684  */
11685  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
11686  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
11687  __pyx_v_itemp = __pyx_t_7;
11688 
11689  /* "View.MemoryView":397
11690  * cdef char *itemp = <char *> self.view.buf
11691  *
11692  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11693  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11694  *
11695  */
11696  }
11697  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11698 
11699  /* "View.MemoryView":400
11700  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11701  *
11702  * return itemp # <<<<<<<<<<<<<<
11703  *
11704  *
11705  */
11706  __pyx_r = __pyx_v_itemp;
11707  goto __pyx_L0;
11708 
11709  /* "View.MemoryView":393
11710  * PyThread_free_lock(self.lock)
11711  *
11712  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11713  * cdef Py_ssize_t dim
11714  * cdef char *itemp = <char *> self.view.buf
11715  */
11716 
11717  /* function exit code */
11718  __pyx_L1_error:;
11719  __Pyx_XDECREF(__pyx_t_2);
11720  __Pyx_XDECREF(__pyx_t_5);
11721  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11722  __pyx_r = NULL;
11723  __pyx_L0:;
11724  __Pyx_XDECREF(__pyx_v_idx);
11725  __Pyx_RefNannyFinishContext();
11726  return __pyx_r;
11727 }
11728 
11729 /* "View.MemoryView":403
11730  *
11731  *
11732  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11733  * if index is Ellipsis:
11734  * return self
11735  */
11736 
11737 /* Python wrapper */
11738 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
11739 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11740  PyObject *__pyx_r = 0;
11741  __Pyx_RefNannyDeclarations
11742  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11743  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11744 
11745  /* function exit code */
11746  __Pyx_RefNannyFinishContext();
11747  return __pyx_r;
11748 }
11749 
11750 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11751  PyObject *__pyx_v_have_slices = NULL;
11752  PyObject *__pyx_v_indices = NULL;
11753  char *__pyx_v_itemp;
11754  PyObject *__pyx_r = NULL;
11755  __Pyx_RefNannyDeclarations
11756  int __pyx_t_1;
11757  int __pyx_t_2;
11758  PyObject *__pyx_t_3 = NULL;
11759  PyObject *__pyx_t_4 = NULL;
11760  PyObject *__pyx_t_5 = NULL;
11761  char *__pyx_t_6;
11762  int __pyx_lineno = 0;
11763  const char *__pyx_filename = NULL;
11764  int __pyx_clineno = 0;
11765  __Pyx_RefNannySetupContext("__getitem__", 0);
11766 
11767  /* "View.MemoryView":404
11768  *
11769  * def __getitem__(memoryview self, object index):
11770  * if index is Ellipsis: # <<<<<<<<<<<<<<
11771  * return self
11772  *
11773  */
11774  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11775  __pyx_t_2 = (__pyx_t_1 != 0);
11776  if (__pyx_t_2) {
11777 
11778  /* "View.MemoryView":405
11779  * def __getitem__(memoryview self, object index):
11780  * if index is Ellipsis:
11781  * return self # <<<<<<<<<<<<<<
11782  *
11783  * have_slices, indices = _unellipsify(index, self.view.ndim)
11784  */
11785  __Pyx_XDECREF(__pyx_r);
11786  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11787  __pyx_r = ((PyObject *)__pyx_v_self);
11788  goto __pyx_L0;
11789 
11790  /* "View.MemoryView":404
11791  *
11792  * def __getitem__(memoryview self, object index):
11793  * if index is Ellipsis: # <<<<<<<<<<<<<<
11794  * return self
11795  *
11796  */
11797  }
11798 
11799  /* "View.MemoryView":407
11800  * return self
11801  *
11802  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11803  *
11804  * cdef char *itemp
11805  */
11806  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
11807  __Pyx_GOTREF(__pyx_t_3);
11808  if (likely(__pyx_t_3 != Py_None)) {
11809  PyObject* sequence = __pyx_t_3;
11810  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11811  if (unlikely(size != 2)) {
11812  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11813  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11814  __PYX_ERR(1, 407, __pyx_L1_error)
11815  }
11816  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11817  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11818  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11819  __Pyx_INCREF(__pyx_t_4);
11820  __Pyx_INCREF(__pyx_t_5);
11821  #else
11822  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
11823  __Pyx_GOTREF(__pyx_t_4);
11824  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
11825  __Pyx_GOTREF(__pyx_t_5);
11826  #endif
11827  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11828  } else {
11829  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
11830  }
11831  __pyx_v_have_slices = __pyx_t_4;
11832  __pyx_t_4 = 0;
11833  __pyx_v_indices = __pyx_t_5;
11834  __pyx_t_5 = 0;
11835 
11836  /* "View.MemoryView":410
11837  *
11838  * cdef char *itemp
11839  * if have_slices: # <<<<<<<<<<<<<<
11840  * return memview_slice(self, indices)
11841  * else:
11842  */
11843  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
11844  if (__pyx_t_2) {
11845 
11846  /* "View.MemoryView":411
11847  * cdef char *itemp
11848  * if have_slices:
11849  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11850  * else:
11851  * itemp = self.get_item_pointer(indices)
11852  */
11853  __Pyx_XDECREF(__pyx_r);
11854  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
11855  __Pyx_GOTREF(__pyx_t_3);
11856  __pyx_r = __pyx_t_3;
11857  __pyx_t_3 = 0;
11858  goto __pyx_L0;
11859 
11860  /* "View.MemoryView":410
11861  *
11862  * cdef char *itemp
11863  * if have_slices: # <<<<<<<<<<<<<<
11864  * return memview_slice(self, indices)
11865  * else:
11866  */
11867  }
11868 
11869  /* "View.MemoryView":413
11870  * return memview_slice(self, indices)
11871  * else:
11872  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11873  * return self.convert_item_to_object(itemp)
11874  *
11875  */
11876  /*else*/ {
11877  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
11878  __pyx_v_itemp = __pyx_t_6;
11879 
11880  /* "View.MemoryView":414
11881  * else:
11882  * itemp = self.get_item_pointer(indices)
11883  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11884  *
11885  * def __setitem__(memoryview self, object index, object value):
11886  */
11887  __Pyx_XDECREF(__pyx_r);
11888  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
11889  __Pyx_GOTREF(__pyx_t_3);
11890  __pyx_r = __pyx_t_3;
11891  __pyx_t_3 = 0;
11892  goto __pyx_L0;
11893  }
11894 
11895  /* "View.MemoryView":403
11896  *
11897  *
11898  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11899  * if index is Ellipsis:
11900  * return self
11901  */
11902 
11903  /* function exit code */
11904  __pyx_L1_error:;
11905  __Pyx_XDECREF(__pyx_t_3);
11906  __Pyx_XDECREF(__pyx_t_4);
11907  __Pyx_XDECREF(__pyx_t_5);
11908  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11909  __pyx_r = NULL;
11910  __pyx_L0:;
11911  __Pyx_XDECREF(__pyx_v_have_slices);
11912  __Pyx_XDECREF(__pyx_v_indices);
11913  __Pyx_XGIVEREF(__pyx_r);
11914  __Pyx_RefNannyFinishContext();
11915  return __pyx_r;
11916 }
11917 
11918 /* "View.MemoryView":416
11919  * return self.convert_item_to_object(itemp)
11920  *
11921  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11922  * if self.view.readonly:
11923  * raise TypeError("Cannot assign to read-only memoryview")
11924  */
11925 
11926 /* Python wrapper */
11927 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11928 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11929  int __pyx_r;
11930  __Pyx_RefNannyDeclarations
11931  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11932  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11933 
11934  /* function exit code */
11935  __Pyx_RefNannyFinishContext();
11936  return __pyx_r;
11937 }
11938 
11939 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11940  PyObject *__pyx_v_have_slices = NULL;
11941  PyObject *__pyx_v_obj = NULL;
11942  int __pyx_r;
11943  __Pyx_RefNannyDeclarations
11944  int __pyx_t_1;
11945  PyObject *__pyx_t_2 = NULL;
11946  PyObject *__pyx_t_3 = NULL;
11947  PyObject *__pyx_t_4 = NULL;
11948  int __pyx_lineno = 0;
11949  const char *__pyx_filename = NULL;
11950  int __pyx_clineno = 0;
11951  __Pyx_RefNannySetupContext("__setitem__", 0);
11952  __Pyx_INCREF(__pyx_v_index);
11953 
11954  /* "View.MemoryView":417
11955  *
11956  * def __setitem__(memoryview self, object index, object value):
11957  * if self.view.readonly: # <<<<<<<<<<<<<<
11958  * raise TypeError("Cannot assign to read-only memoryview")
11959  *
11960  */
11961  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11962  if (unlikely(__pyx_t_1)) {
11963 
11964  /* "View.MemoryView":418
11965  * def __setitem__(memoryview self, object index, object value):
11966  * if self.view.readonly:
11967  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11968  *
11969  * have_slices, index = _unellipsify(index, self.view.ndim)
11970  */
11971  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11972  __Pyx_GOTREF(__pyx_t_2);
11973  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11974  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11975  __PYX_ERR(1, 418, __pyx_L1_error)
11976 
11977  /* "View.MemoryView":417
11978  *
11979  * def __setitem__(memoryview self, object index, object value):
11980  * if self.view.readonly: # <<<<<<<<<<<<<<
11981  * raise TypeError("Cannot assign to read-only memoryview")
11982  *
11983  */
11984  }
11985 
11986  /* "View.MemoryView":420
11987  * raise TypeError("Cannot assign to read-only memoryview")
11988  *
11989  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11990  *
11991  * if have_slices:
11992  */
11993  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11994  __Pyx_GOTREF(__pyx_t_2);
11995  if (likely(__pyx_t_2 != Py_None)) {
11996  PyObject* sequence = __pyx_t_2;
11997  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11998  if (unlikely(size != 2)) {
11999  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12000  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12001  __PYX_ERR(1, 420, __pyx_L1_error)
12002  }
12003  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12004  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
12005  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
12006  __Pyx_INCREF(__pyx_t_3);
12007  __Pyx_INCREF(__pyx_t_4);
12008  #else
12009  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
12010  __Pyx_GOTREF(__pyx_t_3);
12011  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
12012  __Pyx_GOTREF(__pyx_t_4);
12013  #endif
12014  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12015  } else {
12016  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
12017  }
12018  __pyx_v_have_slices = __pyx_t_3;
12019  __pyx_t_3 = 0;
12020  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
12021  __pyx_t_4 = 0;
12022 
12023  /* "View.MemoryView":422
12024  * have_slices, index = _unellipsify(index, self.view.ndim)
12025  *
12026  * if have_slices: # <<<<<<<<<<<<<<
12027  * obj = self.is_slice(value)
12028  * if obj:
12029  */
12030  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
12031  if (__pyx_t_1) {
12032 
12033  /* "View.MemoryView":423
12034  *
12035  * if have_slices:
12036  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
12037  * if obj:
12038  * self.setitem_slice_assignment(self[index], obj)
12039  */
12040  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
12041  __Pyx_GOTREF(__pyx_t_2);
12042  __pyx_v_obj = __pyx_t_2;
12043  __pyx_t_2 = 0;
12044 
12045  /* "View.MemoryView":424
12046  * if have_slices:
12047  * obj = self.is_slice(value)
12048  * if obj: # <<<<<<<<<<<<<<
12049  * self.setitem_slice_assignment(self[index], obj)
12050  * else:
12051  */
12052  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
12053  if (__pyx_t_1) {
12054 
12055  /* "View.MemoryView":425
12056  * obj = self.is_slice(value)
12057  * if obj:
12058  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
12059  * else:
12060  * self.setitem_slice_assign_scalar(self[index], value)
12061  */
12062  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
12063  __Pyx_GOTREF(__pyx_t_2);
12064  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
12065  __Pyx_GOTREF(__pyx_t_4);
12066  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12067  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12068 
12069  /* "View.MemoryView":424
12070  * if have_slices:
12071  * obj = self.is_slice(value)
12072  * if obj: # <<<<<<<<<<<<<<
12073  * self.setitem_slice_assignment(self[index], obj)
12074  * else:
12075  */
12076  goto __pyx_L5;
12077  }
12078 
12079  /* "View.MemoryView":427
12080  * self.setitem_slice_assignment(self[index], obj)
12081  * else:
12082  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
12083  * else:
12084  * self.setitem_indexed(index, value)
12085  */
12086  /*else*/ {
12087  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
12088  __Pyx_GOTREF(__pyx_t_4);
12089  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
12090  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
12091  __Pyx_GOTREF(__pyx_t_2);
12092  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12093  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12094  }
12095  __pyx_L5:;
12096 
12097  /* "View.MemoryView":422
12098  * have_slices, index = _unellipsify(index, self.view.ndim)
12099  *
12100  * if have_slices: # <<<<<<<<<<<<<<
12101  * obj = self.is_slice(value)
12102  * if obj:
12103  */
12104  goto __pyx_L4;
12105  }
12106 
12107  /* "View.MemoryView":429
12108  * self.setitem_slice_assign_scalar(self[index], value)
12109  * else:
12110  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
12111  *
12112  * cdef is_slice(self, obj):
12113  */
12114  /*else*/ {
12115  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
12116  __Pyx_GOTREF(__pyx_t_2);
12117  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12118  }
12119  __pyx_L4:;
12120 
12121  /* "View.MemoryView":416
12122  * return self.convert_item_to_object(itemp)
12123  *
12124  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
12125  * if self.view.readonly:
12126  * raise TypeError("Cannot assign to read-only memoryview")
12127  */
12128 
12129  /* function exit code */
12130  __pyx_r = 0;
12131  goto __pyx_L0;
12132  __pyx_L1_error:;
12133  __Pyx_XDECREF(__pyx_t_2);
12134  __Pyx_XDECREF(__pyx_t_3);
12135  __Pyx_XDECREF(__pyx_t_4);
12136  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12137  __pyx_r = -1;
12138  __pyx_L0:;
12139  __Pyx_XDECREF(__pyx_v_have_slices);
12140  __Pyx_XDECREF(__pyx_v_obj);
12141  __Pyx_XDECREF(__pyx_v_index);
12142  __Pyx_RefNannyFinishContext();
12143  return __pyx_r;
12144 }
12145 
12146 /* "View.MemoryView":431
12147  * self.setitem_indexed(index, value)
12148  *
12149  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12150  * if not isinstance(obj, memoryview):
12151  * try:
12152  */
12153 
12154 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
12155  PyObject *__pyx_r = NULL;
12156  __Pyx_RefNannyDeclarations
12157  int __pyx_t_1;
12158  int __pyx_t_2;
12159  PyObject *__pyx_t_3 = NULL;
12160  PyObject *__pyx_t_4 = NULL;
12161  PyObject *__pyx_t_5 = NULL;
12162  PyObject *__pyx_t_6 = NULL;
12163  PyObject *__pyx_t_7 = NULL;
12164  PyObject *__pyx_t_8 = NULL;
12165  int __pyx_t_9;
12166  int __pyx_lineno = 0;
12167  const char *__pyx_filename = NULL;
12168  int __pyx_clineno = 0;
12169  __Pyx_RefNannySetupContext("is_slice", 0);
12170  __Pyx_INCREF(__pyx_v_obj);
12171 
12172  /* "View.MemoryView":432
12173  *
12174  * cdef is_slice(self, obj):
12175  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12176  * try:
12177  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12178  */
12179  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
12180  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12181  if (__pyx_t_2) {
12182 
12183  /* "View.MemoryView":433
12184  * cdef is_slice(self, obj):
12185  * if not isinstance(obj, memoryview):
12186  * try: # <<<<<<<<<<<<<<
12187  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12188  * self.dtype_is_object)
12189  */
12190  {
12191  __Pyx_PyThreadState_declare
12192  __Pyx_PyThreadState_assign
12193  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
12194  __Pyx_XGOTREF(__pyx_t_3);
12195  __Pyx_XGOTREF(__pyx_t_4);
12196  __Pyx_XGOTREF(__pyx_t_5);
12197  /*try:*/ {
12198 
12199  /* "View.MemoryView":434
12200  * if not isinstance(obj, memoryview):
12201  * try:
12202  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12203  * self.dtype_is_object)
12204  * except TypeError:
12205  */
12206  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
12207  __Pyx_GOTREF(__pyx_t_6);
12208 
12209  /* "View.MemoryView":435
12210  * try:
12211  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12212  * self.dtype_is_object) # <<<<<<<<<<<<<<
12213  * except TypeError:
12214  * return None
12215  */
12216  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
12217  __Pyx_GOTREF(__pyx_t_7);
12218 
12219  /* "View.MemoryView":434
12220  * if not isinstance(obj, memoryview):
12221  * try:
12222  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12223  * self.dtype_is_object)
12224  * except TypeError:
12225  */
12226  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
12227  __Pyx_GOTREF(__pyx_t_8);
12228  __Pyx_INCREF(__pyx_v_obj);
12229  __Pyx_GIVEREF(__pyx_v_obj);
12230  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
12231  __Pyx_GIVEREF(__pyx_t_6);
12232  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
12233  __Pyx_GIVEREF(__pyx_t_7);
12234  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
12235  __pyx_t_6 = 0;
12236  __pyx_t_7 = 0;
12237  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
12238  __Pyx_GOTREF(__pyx_t_7);
12239  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12240  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
12241  __pyx_t_7 = 0;
12242 
12243  /* "View.MemoryView":433
12244  * cdef is_slice(self, obj):
12245  * if not isinstance(obj, memoryview):
12246  * try: # <<<<<<<<<<<<<<
12247  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12248  * self.dtype_is_object)
12249  */
12250  }
12251  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12252  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12253  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12254  goto __pyx_L9_try_end;
12255  __pyx_L4_error:;
12256  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12257  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12258  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12259 
12260  /* "View.MemoryView":436
12261  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12262  * self.dtype_is_object)
12263  * except TypeError: # <<<<<<<<<<<<<<
12264  * return None
12265  *
12266  */
12267  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12268  if (__pyx_t_9) {
12269  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12270  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
12271  __Pyx_GOTREF(__pyx_t_7);
12272  __Pyx_GOTREF(__pyx_t_8);
12273  __Pyx_GOTREF(__pyx_t_6);
12274 
12275  /* "View.MemoryView":437
12276  * self.dtype_is_object)
12277  * except TypeError:
12278  * return None # <<<<<<<<<<<<<<
12279  *
12280  * return obj
12281  */
12282  __Pyx_XDECREF(__pyx_r);
12283  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12284  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12285  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12286  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12287  goto __pyx_L7_except_return;
12288  }
12289  goto __pyx_L6_except_error;
12290  __pyx_L6_except_error:;
12291 
12292  /* "View.MemoryView":433
12293  * cdef is_slice(self, obj):
12294  * if not isinstance(obj, memoryview):
12295  * try: # <<<<<<<<<<<<<<
12296  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12297  * self.dtype_is_object)
12298  */
12299  __Pyx_XGIVEREF(__pyx_t_3);
12300  __Pyx_XGIVEREF(__pyx_t_4);
12301  __Pyx_XGIVEREF(__pyx_t_5);
12302  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12303  goto __pyx_L1_error;
12304  __pyx_L7_except_return:;
12305  __Pyx_XGIVEREF(__pyx_t_3);
12306  __Pyx_XGIVEREF(__pyx_t_4);
12307  __Pyx_XGIVEREF(__pyx_t_5);
12308  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12309  goto __pyx_L0;
12310  __pyx_L9_try_end:;
12311  }
12312 
12313  /* "View.MemoryView":432
12314  *
12315  * cdef is_slice(self, obj):
12316  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12317  * try:
12318  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12319  */
12320  }
12321 
12322  /* "View.MemoryView":439
12323  * return None
12324  *
12325  * return obj # <<<<<<<<<<<<<<
12326  *
12327  * cdef setitem_slice_assignment(self, dst, src):
12328  */
12329  __Pyx_XDECREF(__pyx_r);
12330  __Pyx_INCREF(__pyx_v_obj);
12331  __pyx_r = __pyx_v_obj;
12332  goto __pyx_L0;
12333 
12334  /* "View.MemoryView":431
12335  * self.setitem_indexed(index, value)
12336  *
12337  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12338  * if not isinstance(obj, memoryview):
12339  * try:
12340  */
12341 
12342  /* function exit code */
12343  __pyx_L1_error:;
12344  __Pyx_XDECREF(__pyx_t_6);
12345  __Pyx_XDECREF(__pyx_t_7);
12346  __Pyx_XDECREF(__pyx_t_8);
12347  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12348  __pyx_r = 0;
12349  __pyx_L0:;
12350  __Pyx_XDECREF(__pyx_v_obj);
12351  __Pyx_XGIVEREF(__pyx_r);
12352  __Pyx_RefNannyFinishContext();
12353  return __pyx_r;
12354 }
12355 
12356 /* "View.MemoryView":441
12357  * return obj
12358  *
12359  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12360  * cdef __Pyx_memviewslice dst_slice
12361  * cdef __Pyx_memviewslice src_slice
12362  */
12363 
12364 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12365  __Pyx_memviewslice __pyx_v_dst_slice;
12366  __Pyx_memviewslice __pyx_v_src_slice;
12367  PyObject *__pyx_r = NULL;
12368  __Pyx_RefNannyDeclarations
12369  __Pyx_memviewslice *__pyx_t_1;
12370  __Pyx_memviewslice *__pyx_t_2;
12371  PyObject *__pyx_t_3 = NULL;
12372  int __pyx_t_4;
12373  int __pyx_t_5;
12374  int __pyx_t_6;
12375  int __pyx_lineno = 0;
12376  const char *__pyx_filename = NULL;
12377  int __pyx_clineno = 0;
12378  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
12379 
12380  /* "View.MemoryView":445
12381  * cdef __Pyx_memviewslice src_slice
12382  *
12383  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12384  * get_slice_from_memview(dst, &dst_slice)[0],
12385  * src.ndim, dst.ndim, self.dtype_is_object)
12386  */
12387  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
12388  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
12389 
12390  /* "View.MemoryView":446
12391  *
12392  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12393  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
12394  * src.ndim, dst.ndim, self.dtype_is_object)
12395  *
12396  */
12397  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
12398  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
12399 
12400  /* "View.MemoryView":447
12401  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12402  * get_slice_from_memview(dst, &dst_slice)[0],
12403  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
12404  *
12405  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12406  */
12407  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
12408  __Pyx_GOTREF(__pyx_t_3);
12409  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
12410  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12411  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
12412  __Pyx_GOTREF(__pyx_t_3);
12413  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
12414  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12415 
12416  /* "View.MemoryView":445
12417  * cdef __Pyx_memviewslice src_slice
12418  *
12419  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12420  * get_slice_from_memview(dst, &dst_slice)[0],
12421  * src.ndim, dst.ndim, self.dtype_is_object)
12422  */
12423  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
12424 
12425  /* "View.MemoryView":441
12426  * return obj
12427  *
12428  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12429  * cdef __Pyx_memviewslice dst_slice
12430  * cdef __Pyx_memviewslice src_slice
12431  */
12432 
12433  /* function exit code */
12434  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12435  goto __pyx_L0;
12436  __pyx_L1_error:;
12437  __Pyx_XDECREF(__pyx_t_3);
12438  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12439  __pyx_r = 0;
12440  __pyx_L0:;
12441  __Pyx_XGIVEREF(__pyx_r);
12442  __Pyx_RefNannyFinishContext();
12443  return __pyx_r;
12444 }
12445 
12446 /* "View.MemoryView":449
12447  * src.ndim, dst.ndim, self.dtype_is_object)
12448  *
12449  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12450  * cdef int array[128]
12451  * cdef void *tmp = NULL
12452  */
12453 
12454 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12455  int __pyx_v_array[0x80];
12456  void *__pyx_v_tmp;
12457  void *__pyx_v_item;
12458  __Pyx_memviewslice *__pyx_v_dst_slice;
12459  __Pyx_memviewslice __pyx_v_tmp_slice;
12460  PyObject *__pyx_r = NULL;
12461  __Pyx_RefNannyDeclarations
12462  __Pyx_memviewslice *__pyx_t_1;
12463  int __pyx_t_2;
12464  PyObject *__pyx_t_3 = NULL;
12465  int __pyx_t_4;
12466  int __pyx_t_5;
12467  char const *__pyx_t_6;
12468  PyObject *__pyx_t_7 = NULL;
12469  PyObject *__pyx_t_8 = NULL;
12470  PyObject *__pyx_t_9 = NULL;
12471  PyObject *__pyx_t_10 = NULL;
12472  PyObject *__pyx_t_11 = NULL;
12473  PyObject *__pyx_t_12 = NULL;
12474  int __pyx_lineno = 0;
12475  const char *__pyx_filename = NULL;
12476  int __pyx_clineno = 0;
12477  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
12478 
12479  /* "View.MemoryView":451
12480  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12481  * cdef int array[128]
12482  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
12483  * cdef void *item
12484  *
12485  */
12486  __pyx_v_tmp = NULL;
12487 
12488  /* "View.MemoryView":456
12489  * cdef __Pyx_memviewslice *dst_slice
12490  * cdef __Pyx_memviewslice tmp_slice
12491  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
12492  *
12493  * if <size_t>self.view.itemsize > sizeof(array):
12494  */
12495  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
12496  __pyx_v_dst_slice = __pyx_t_1;
12497 
12498  /* "View.MemoryView":458
12499  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12500  *
12501  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12502  * tmp = PyMem_Malloc(self.view.itemsize)
12503  * if tmp == NULL:
12504  */
12505  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
12506  if (__pyx_t_2) {
12507 
12508  /* "View.MemoryView":459
12509  *
12510  * if <size_t>self.view.itemsize > sizeof(array):
12511  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
12512  * if tmp == NULL:
12513  * raise MemoryError
12514  */
12515  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12516 
12517  /* "View.MemoryView":460
12518  * if <size_t>self.view.itemsize > sizeof(array):
12519  * tmp = PyMem_Malloc(self.view.itemsize)
12520  * if tmp == NULL: # <<<<<<<<<<<<<<
12521  * raise MemoryError
12522  * item = tmp
12523  */
12524  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
12525  if (unlikely(__pyx_t_2)) {
12526 
12527  /* "View.MemoryView":461
12528  * tmp = PyMem_Malloc(self.view.itemsize)
12529  * if tmp == NULL:
12530  * raise MemoryError # <<<<<<<<<<<<<<
12531  * item = tmp
12532  * else:
12533  */
12534  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
12535 
12536  /* "View.MemoryView":460
12537  * if <size_t>self.view.itemsize > sizeof(array):
12538  * tmp = PyMem_Malloc(self.view.itemsize)
12539  * if tmp == NULL: # <<<<<<<<<<<<<<
12540  * raise MemoryError
12541  * item = tmp
12542  */
12543  }
12544 
12545  /* "View.MemoryView":462
12546  * if tmp == NULL:
12547  * raise MemoryError
12548  * item = tmp # <<<<<<<<<<<<<<
12549  * else:
12550  * item = <void *> array
12551  */
12552  __pyx_v_item = __pyx_v_tmp;
12553 
12554  /* "View.MemoryView":458
12555  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12556  *
12557  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12558  * tmp = PyMem_Malloc(self.view.itemsize)
12559  * if tmp == NULL:
12560  */
12561  goto __pyx_L3;
12562  }
12563 
12564  /* "View.MemoryView":464
12565  * item = tmp
12566  * else:
12567  * item = <void *> array # <<<<<<<<<<<<<<
12568  *
12569  * try:
12570  */
12571  /*else*/ {
12572  __pyx_v_item = ((void *)__pyx_v_array);
12573  }
12574  __pyx_L3:;
12575 
12576  /* "View.MemoryView":466
12577  * item = <void *> array
12578  *
12579  * try: # <<<<<<<<<<<<<<
12580  * if self.dtype_is_object:
12581  * (<PyObject **> item)[0] = <PyObject *> value
12582  */
12583  /*try:*/ {
12584 
12585  /* "View.MemoryView":467
12586  *
12587  * try:
12588  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12589  * (<PyObject **> item)[0] = <PyObject *> value
12590  * else:
12591  */
12592  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12593  if (__pyx_t_2) {
12594 
12595  /* "View.MemoryView":468
12596  * try:
12597  * if self.dtype_is_object:
12598  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12599  * else:
12600  * self.assign_item_from_object(<char *> item, value)
12601  */
12602  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12603 
12604  /* "View.MemoryView":467
12605  *
12606  * try:
12607  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12608  * (<PyObject **> item)[0] = <PyObject *> value
12609  * else:
12610  */
12611  goto __pyx_L8;
12612  }
12613 
12614  /* "View.MemoryView":470
12615  * (<PyObject **> item)[0] = <PyObject *> value
12616  * else:
12617  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12618  *
12619  *
12620  */
12621  /*else*/ {
12622  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
12623  __Pyx_GOTREF(__pyx_t_3);
12624  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12625  }
12626  __pyx_L8:;
12627 
12628  /* "View.MemoryView":474
12629  *
12630  *
12631  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12632  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12633  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12634  */
12635  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12636  if (__pyx_t_2) {
12637 
12638  /* "View.MemoryView":475
12639  *
12640  * if self.view.suboffsets != NULL:
12641  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12642  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12643  * item, self.dtype_is_object)
12644  */
12645  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
12646  __Pyx_GOTREF(__pyx_t_3);
12647  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12648 
12649  /* "View.MemoryView":474
12650  *
12651  *
12652  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12653  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12654  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12655  */
12656  }
12657 
12658  /* "View.MemoryView":476
12659  * if self.view.suboffsets != NULL:
12660  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12661  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12662  * item, self.dtype_is_object)
12663  * finally:
12664  */
12665  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12666  }
12667 
12668  /* "View.MemoryView":479
12669  * item, self.dtype_is_object)
12670  * finally:
12671  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12672  *
12673  * cdef setitem_indexed(self, index, value):
12674  */
12675  /*finally:*/ {
12676  /*normal exit:*/{
12677  PyMem_Free(__pyx_v_tmp);
12678  goto __pyx_L7;
12679  }
12680  __pyx_L6_error:;
12681  /*exception exit:*/{
12682  __Pyx_PyThreadState_declare
12683  __Pyx_PyThreadState_assign
12684  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12685  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12686  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
12687  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
12688  __Pyx_XGOTREF(__pyx_t_7);
12689  __Pyx_XGOTREF(__pyx_t_8);
12690  __Pyx_XGOTREF(__pyx_t_9);
12691  __Pyx_XGOTREF(__pyx_t_10);
12692  __Pyx_XGOTREF(__pyx_t_11);
12693  __Pyx_XGOTREF(__pyx_t_12);
12694  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12695  {
12696  PyMem_Free(__pyx_v_tmp);
12697  }
12698  if (PY_MAJOR_VERSION >= 3) {
12699  __Pyx_XGIVEREF(__pyx_t_10);
12700  __Pyx_XGIVEREF(__pyx_t_11);
12701  __Pyx_XGIVEREF(__pyx_t_12);
12702  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12703  }
12704  __Pyx_XGIVEREF(__pyx_t_7);
12705  __Pyx_XGIVEREF(__pyx_t_8);
12706  __Pyx_XGIVEREF(__pyx_t_9);
12707  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12708  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12709  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12710  goto __pyx_L1_error;
12711  }
12712  __pyx_L7:;
12713  }
12714 
12715  /* "View.MemoryView":449
12716  * src.ndim, dst.ndim, self.dtype_is_object)
12717  *
12718  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12719  * cdef int array[128]
12720  * cdef void *tmp = NULL
12721  */
12722 
12723  /* function exit code */
12724  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12725  goto __pyx_L0;
12726  __pyx_L1_error:;
12727  __Pyx_XDECREF(__pyx_t_3);
12728  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12729  __pyx_r = 0;
12730  __pyx_L0:;
12731  __Pyx_XGIVEREF(__pyx_r);
12732  __Pyx_RefNannyFinishContext();
12733  return __pyx_r;
12734 }
12735 
12736 /* "View.MemoryView":481
12737  * PyMem_Free(tmp)
12738  *
12739  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12740  * cdef char *itemp = self.get_item_pointer(index)
12741  * self.assign_item_from_object(itemp, value)
12742  */
12743 
12744 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12745  char *__pyx_v_itemp;
12746  PyObject *__pyx_r = NULL;
12747  __Pyx_RefNannyDeclarations
12748  char *__pyx_t_1;
12749  PyObject *__pyx_t_2 = NULL;
12750  int __pyx_lineno = 0;
12751  const char *__pyx_filename = NULL;
12752  int __pyx_clineno = 0;
12753  __Pyx_RefNannySetupContext("setitem_indexed", 0);
12754 
12755  /* "View.MemoryView":482
12756  *
12757  * cdef setitem_indexed(self, index, value):
12758  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
12759  * self.assign_item_from_object(itemp, value)
12760  *
12761  */
12762  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
12763  __pyx_v_itemp = __pyx_t_1;
12764 
12765  /* "View.MemoryView":483
12766  * cdef setitem_indexed(self, index, value):
12767  * cdef char *itemp = self.get_item_pointer(index)
12768  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
12769  *
12770  * cdef convert_item_to_object(self, char *itemp):
12771  */
12772  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
12773  __Pyx_GOTREF(__pyx_t_2);
12774  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12775 
12776  /* "View.MemoryView":481
12777  * PyMem_Free(tmp)
12778  *
12779  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12780  * cdef char *itemp = self.get_item_pointer(index)
12781  * self.assign_item_from_object(itemp, value)
12782  */
12783 
12784  /* function exit code */
12785  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12786  goto __pyx_L0;
12787  __pyx_L1_error:;
12788  __Pyx_XDECREF(__pyx_t_2);
12789  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12790  __pyx_r = 0;
12791  __pyx_L0:;
12792  __Pyx_XGIVEREF(__pyx_r);
12793  __Pyx_RefNannyFinishContext();
12794  return __pyx_r;
12795 }
12796 
12797 /* "View.MemoryView":485
12798  * self.assign_item_from_object(itemp, value)
12799  *
12800  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12801  * """Only used if instantiated manually by the user, or if Cython doesn't
12802  * know how to convert the type"""
12803  */
12804 
12805 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
12806  PyObject *__pyx_v_struct = NULL;
12807  PyObject *__pyx_v_bytesitem = 0;
12808  PyObject *__pyx_v_result = NULL;
12809  PyObject *__pyx_r = NULL;
12810  __Pyx_RefNannyDeclarations
12811  PyObject *__pyx_t_1 = NULL;
12812  PyObject *__pyx_t_2 = NULL;
12813  PyObject *__pyx_t_3 = NULL;
12814  PyObject *__pyx_t_4 = NULL;
12815  PyObject *__pyx_t_5 = NULL;
12816  PyObject *__pyx_t_6 = NULL;
12817  PyObject *__pyx_t_7 = NULL;
12818  int __pyx_t_8;
12819  PyObject *__pyx_t_9 = NULL;
12820  size_t __pyx_t_10;
12821  int __pyx_t_11;
12822  int __pyx_lineno = 0;
12823  const char *__pyx_filename = NULL;
12824  int __pyx_clineno = 0;
12825  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
12826 
12827  /* "View.MemoryView":488
12828  * """Only used if instantiated manually by the user, or if Cython doesn't
12829  * know how to convert the type"""
12830  * import struct # <<<<<<<<<<<<<<
12831  * cdef bytes bytesitem
12832  *
12833  */
12834  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
12835  __Pyx_GOTREF(__pyx_t_1);
12836  __pyx_v_struct = __pyx_t_1;
12837  __pyx_t_1 = 0;
12838 
12839  /* "View.MemoryView":491
12840  * cdef bytes bytesitem
12841  *
12842  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
12843  * try:
12844  * result = struct.unpack(self.view.format, bytesitem)
12845  */
12846  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
12847  __Pyx_GOTREF(__pyx_t_1);
12848  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12849  __pyx_t_1 = 0;
12850 
12851  /* "View.MemoryView":492
12852  *
12853  * bytesitem = itemp[:self.view.itemsize]
12854  * try: # <<<<<<<<<<<<<<
12855  * result = struct.unpack(self.view.format, bytesitem)
12856  * except struct.error:
12857  */
12858  {
12859  __Pyx_PyThreadState_declare
12860  __Pyx_PyThreadState_assign
12861  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12862  __Pyx_XGOTREF(__pyx_t_2);
12863  __Pyx_XGOTREF(__pyx_t_3);
12864  __Pyx_XGOTREF(__pyx_t_4);
12865  /*try:*/ {
12866 
12867  /* "View.MemoryView":493
12868  * bytesitem = itemp[:self.view.itemsize]
12869  * try:
12870  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12871  * except struct.error:
12872  * raise ValueError("Unable to convert item to object")
12873  */
12874  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
12875  __Pyx_GOTREF(__pyx_t_5);
12876  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
12877  __Pyx_GOTREF(__pyx_t_6);
12878  __pyx_t_7 = NULL;
12879  __pyx_t_8 = 0;
12880  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12881  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12882  if (likely(__pyx_t_7)) {
12883  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12884  __Pyx_INCREF(__pyx_t_7);
12885  __Pyx_INCREF(function);
12886  __Pyx_DECREF_SET(__pyx_t_5, function);
12887  __pyx_t_8 = 1;
12888  }
12889  }
12890  #if CYTHON_FAST_PYCALL
12891  if (PyFunction_Check(__pyx_t_5)) {
12892  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12893  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12894  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12895  __Pyx_GOTREF(__pyx_t_1);
12896  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12897  } else
12898  #endif
12899  #if CYTHON_FAST_PYCCALL
12900  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12901  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12902  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12903  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12904  __Pyx_GOTREF(__pyx_t_1);
12905  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12906  } else
12907  #endif
12908  {
12909  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
12910  __Pyx_GOTREF(__pyx_t_9);
12911  if (__pyx_t_7) {
12912  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12913  }
12914  __Pyx_GIVEREF(__pyx_t_6);
12915  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12916  __Pyx_INCREF(__pyx_v_bytesitem);
12917  __Pyx_GIVEREF(__pyx_v_bytesitem);
12918  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12919  __pyx_t_6 = 0;
12920  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12921  __Pyx_GOTREF(__pyx_t_1);
12922  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12923  }
12924  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12925  __pyx_v_result = __pyx_t_1;
12926  __pyx_t_1 = 0;
12927 
12928  /* "View.MemoryView":492
12929  *
12930  * bytesitem = itemp[:self.view.itemsize]
12931  * try: # <<<<<<<<<<<<<<
12932  * result = struct.unpack(self.view.format, bytesitem)
12933  * except struct.error:
12934  */
12935  }
12936 
12937  /* "View.MemoryView":497
12938  * raise ValueError("Unable to convert item to object")
12939  * else:
12940  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12941  * return result[0]
12942  * return result
12943  */
12944  /*else:*/ {
12945  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12946  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12947  if (__pyx_t_11) {
12948 
12949  /* "View.MemoryView":498
12950  * else:
12951  * if len(self.view.format) == 1:
12952  * return result[0] # <<<<<<<<<<<<<<
12953  * return result
12954  *
12955  */
12956  __Pyx_XDECREF(__pyx_r);
12957  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
12958  __Pyx_GOTREF(__pyx_t_1);
12959  __pyx_r = __pyx_t_1;
12960  __pyx_t_1 = 0;
12961  goto __pyx_L6_except_return;
12962 
12963  /* "View.MemoryView":497
12964  * raise ValueError("Unable to convert item to object")
12965  * else:
12966  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12967  * return result[0]
12968  * return result
12969  */
12970  }
12971 
12972  /* "View.MemoryView":499
12973  * if len(self.view.format) == 1:
12974  * return result[0]
12975  * return result # <<<<<<<<<<<<<<
12976  *
12977  * cdef assign_item_from_object(self, char *itemp, object value):
12978  */
12979  __Pyx_XDECREF(__pyx_r);
12980  __Pyx_INCREF(__pyx_v_result);
12981  __pyx_r = __pyx_v_result;
12982  goto __pyx_L6_except_return;
12983  }
12984  __pyx_L3_error:;
12985  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12986  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12987  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12988  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12989  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12990 
12991  /* "View.MemoryView":494
12992  * try:
12993  * result = struct.unpack(self.view.format, bytesitem)
12994  * except struct.error: # <<<<<<<<<<<<<<
12995  * raise ValueError("Unable to convert item to object")
12996  * else:
12997  */
12998  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12999  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
13000  __Pyx_GOTREF(__pyx_t_6);
13001  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
13002  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13003  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
13004  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
13005  if (__pyx_t_8) {
13006  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13007  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
13008  __Pyx_GOTREF(__pyx_t_9);
13009  __Pyx_GOTREF(__pyx_t_5);
13010  __Pyx_GOTREF(__pyx_t_1);
13011 
13012  /* "View.MemoryView":495
13013  * result = struct.unpack(self.view.format, bytesitem)
13014  * except struct.error:
13015  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
13016  * else:
13017  * if len(self.view.format) == 1:
13018  */
13019  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
13020  __Pyx_GOTREF(__pyx_t_6);
13021  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
13022  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13023  __PYX_ERR(1, 495, __pyx_L5_except_error)
13024  }
13025  goto __pyx_L5_except_error;
13026  __pyx_L5_except_error:;
13027 
13028  /* "View.MemoryView":492
13029  *
13030  * bytesitem = itemp[:self.view.itemsize]
13031  * try: # <<<<<<<<<<<<<<
13032  * result = struct.unpack(self.view.format, bytesitem)
13033  * except struct.error:
13034  */
13035  __Pyx_XGIVEREF(__pyx_t_2);
13036  __Pyx_XGIVEREF(__pyx_t_3);
13037  __Pyx_XGIVEREF(__pyx_t_4);
13038  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13039  goto __pyx_L1_error;
13040  __pyx_L6_except_return:;
13041  __Pyx_XGIVEREF(__pyx_t_2);
13042  __Pyx_XGIVEREF(__pyx_t_3);
13043  __Pyx_XGIVEREF(__pyx_t_4);
13044  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13045  goto __pyx_L0;
13046  }
13047 
13048  /* "View.MemoryView":485
13049  * self.assign_item_from_object(itemp, value)
13050  *
13051  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
13052  * """Only used if instantiated manually by the user, or if Cython doesn't
13053  * know how to convert the type"""
13054  */
13055 
13056  /* function exit code */
13057  __pyx_L1_error:;
13058  __Pyx_XDECREF(__pyx_t_1);
13059  __Pyx_XDECREF(__pyx_t_5);
13060  __Pyx_XDECREF(__pyx_t_6);
13061  __Pyx_XDECREF(__pyx_t_7);
13062  __Pyx_XDECREF(__pyx_t_9);
13063  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13064  __pyx_r = 0;
13065  __pyx_L0:;
13066  __Pyx_XDECREF(__pyx_v_struct);
13067  __Pyx_XDECREF(__pyx_v_bytesitem);
13068  __Pyx_XDECREF(__pyx_v_result);
13069  __Pyx_XGIVEREF(__pyx_r);
13070  __Pyx_RefNannyFinishContext();
13071  return __pyx_r;
13072 }
13073 
13074 /* "View.MemoryView":501
13075  * return result
13076  *
13077  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13078  * """Only used if instantiated manually by the user, or if Cython doesn't
13079  * know how to convert the type"""
13080  */
13081 
13082 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
13083  PyObject *__pyx_v_struct = NULL;
13084  char __pyx_v_c;
13085  PyObject *__pyx_v_bytesvalue = 0;
13086  Py_ssize_t __pyx_v_i;
13087  PyObject *__pyx_r = NULL;
13088  __Pyx_RefNannyDeclarations
13089  PyObject *__pyx_t_1 = NULL;
13090  int __pyx_t_2;
13091  int __pyx_t_3;
13092  PyObject *__pyx_t_4 = NULL;
13093  PyObject *__pyx_t_5 = NULL;
13094  PyObject *__pyx_t_6 = NULL;
13095  int __pyx_t_7;
13096  PyObject *__pyx_t_8 = NULL;
13097  Py_ssize_t __pyx_t_9;
13098  PyObject *__pyx_t_10 = NULL;
13099  char *__pyx_t_11;
13100  char *__pyx_t_12;
13101  char *__pyx_t_13;
13102  char *__pyx_t_14;
13103  int __pyx_lineno = 0;
13104  const char *__pyx_filename = NULL;
13105  int __pyx_clineno = 0;
13106  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
13107 
13108  /* "View.MemoryView":504
13109  * """Only used if instantiated manually by the user, or if Cython doesn't
13110  * know how to convert the type"""
13111  * import struct # <<<<<<<<<<<<<<
13112  * cdef char c
13113  * cdef bytes bytesvalue
13114  */
13115  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
13116  __Pyx_GOTREF(__pyx_t_1);
13117  __pyx_v_struct = __pyx_t_1;
13118  __pyx_t_1 = 0;
13119 
13120  /* "View.MemoryView":509
13121  * cdef Py_ssize_t i
13122  *
13123  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
13124  * bytesvalue = struct.pack(self.view.format, *value)
13125  * else:
13126  */
13127  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
13128  __pyx_t_3 = (__pyx_t_2 != 0);
13129  if (__pyx_t_3) {
13130 
13131  /* "View.MemoryView":510
13132  *
13133  * if isinstance(value, tuple):
13134  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
13135  * else:
13136  * bytesvalue = struct.pack(self.view.format, value)
13137  */
13138  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
13139  __Pyx_GOTREF(__pyx_t_1);
13140  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
13141  __Pyx_GOTREF(__pyx_t_4);
13142  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
13143  __Pyx_GOTREF(__pyx_t_5);
13144  __Pyx_GIVEREF(__pyx_t_4);
13145  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13146  __pyx_t_4 = 0;
13147  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
13148  __Pyx_GOTREF(__pyx_t_4);
13149  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
13150  __Pyx_GOTREF(__pyx_t_6);
13151  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13152  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13153  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
13154  __Pyx_GOTREF(__pyx_t_4);
13155  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13156  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13157  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
13158  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13159  __pyx_t_4 = 0;
13160 
13161  /* "View.MemoryView":509
13162  * cdef Py_ssize_t i
13163  *
13164  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
13165  * bytesvalue = struct.pack(self.view.format, *value)
13166  * else:
13167  */
13168  goto __pyx_L3;
13169  }
13170 
13171  /* "View.MemoryView":512
13172  * bytesvalue = struct.pack(self.view.format, *value)
13173  * else:
13174  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
13175  *
13176  * for i, c in enumerate(bytesvalue):
13177  */
13178  /*else*/ {
13179  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
13180  __Pyx_GOTREF(__pyx_t_6);
13181  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
13182  __Pyx_GOTREF(__pyx_t_1);
13183  __pyx_t_5 = NULL;
13184  __pyx_t_7 = 0;
13185  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
13186  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13187  if (likely(__pyx_t_5)) {
13188  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
13189  __Pyx_INCREF(__pyx_t_5);
13190  __Pyx_INCREF(function);
13191  __Pyx_DECREF_SET(__pyx_t_6, function);
13192  __pyx_t_7 = 1;
13193  }
13194  }
13195  #if CYTHON_FAST_PYCALL
13196  if (PyFunction_Check(__pyx_t_6)) {
13197  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13198  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
13199  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13200  __Pyx_GOTREF(__pyx_t_4);
13201  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13202  } else
13203  #endif
13204  #if CYTHON_FAST_PYCCALL
13205  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13206  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13207  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
13208  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13209  __Pyx_GOTREF(__pyx_t_4);
13210  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13211  } else
13212  #endif
13213  {
13214  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
13215  __Pyx_GOTREF(__pyx_t_8);
13216  if (__pyx_t_5) {
13217  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13218  }
13219  __Pyx_GIVEREF(__pyx_t_1);
13220  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
13221  __Pyx_INCREF(__pyx_v_value);
13222  __Pyx_GIVEREF(__pyx_v_value);
13223  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
13224  __pyx_t_1 = 0;
13225  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
13226  __Pyx_GOTREF(__pyx_t_4);
13227  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13228  }
13229  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13230  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
13231  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13232  __pyx_t_4 = 0;
13233  }
13234  __pyx_L3:;
13235 
13236  /* "View.MemoryView":514
13237  * bytesvalue = struct.pack(self.view.format, value)
13238  *
13239  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13240  * itemp[i] = c
13241  *
13242  */
13243  __pyx_t_9 = 0;
13244  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
13245  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
13246  __PYX_ERR(1, 514, __pyx_L1_error)
13247  }
13248  __Pyx_INCREF(__pyx_v_bytesvalue);
13249  __pyx_t_10 = __pyx_v_bytesvalue;
13250  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
13251  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
13252  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
13253  __pyx_t_11 = __pyx_t_14;
13254  __pyx_v_c = (__pyx_t_11[0]);
13255 
13256  /* "View.MemoryView":515
13257  *
13258  * for i, c in enumerate(bytesvalue):
13259  * itemp[i] = c # <<<<<<<<<<<<<<
13260  *
13261  * @cname('getbuffer')
13262  */
13263  __pyx_v_i = __pyx_t_9;
13264 
13265  /* "View.MemoryView":514
13266  * bytesvalue = struct.pack(self.view.format, value)
13267  *
13268  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13269  * itemp[i] = c
13270  *
13271  */
13272  __pyx_t_9 = (__pyx_t_9 + 1);
13273 
13274  /* "View.MemoryView":515
13275  *
13276  * for i, c in enumerate(bytesvalue):
13277  * itemp[i] = c # <<<<<<<<<<<<<<
13278  *
13279  * @cname('getbuffer')
13280  */
13281  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13282  }
13283  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13284 
13285  /* "View.MemoryView":501
13286  * return result
13287  *
13288  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13289  * """Only used if instantiated manually by the user, or if Cython doesn't
13290  * know how to convert the type"""
13291  */
13292 
13293  /* function exit code */
13294  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13295  goto __pyx_L0;
13296  __pyx_L1_error:;
13297  __Pyx_XDECREF(__pyx_t_1);
13298  __Pyx_XDECREF(__pyx_t_4);
13299  __Pyx_XDECREF(__pyx_t_5);
13300  __Pyx_XDECREF(__pyx_t_6);
13301  __Pyx_XDECREF(__pyx_t_8);
13302  __Pyx_XDECREF(__pyx_t_10);
13303  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13304  __pyx_r = 0;
13305  __pyx_L0:;
13306  __Pyx_XDECREF(__pyx_v_struct);
13307  __Pyx_XDECREF(__pyx_v_bytesvalue);
13308  __Pyx_XGIVEREF(__pyx_r);
13309  __Pyx_RefNannyFinishContext();
13310  return __pyx_r;
13311 }
13312 
13313 /* "View.MemoryView":518
13314  *
13315  * @cname('getbuffer')
13316  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13317  * if flags & PyBUF_WRITABLE and self.view.readonly:
13318  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13319  */
13320 
13321 /* Python wrapper */
13322 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
13323 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13324  int __pyx_r;
13325  __Pyx_RefNannyDeclarations
13326  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
13327  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
13328 
13329  /* function exit code */
13330  __Pyx_RefNannyFinishContext();
13331  return __pyx_r;
13332 }
13333 
13334 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13335  int __pyx_r;
13336  __Pyx_RefNannyDeclarations
13337  int __pyx_t_1;
13338  int __pyx_t_2;
13339  PyObject *__pyx_t_3 = NULL;
13340  Py_ssize_t *__pyx_t_4;
13341  char *__pyx_t_5;
13342  void *__pyx_t_6;
13343  int __pyx_t_7;
13344  Py_ssize_t __pyx_t_8;
13345  int __pyx_lineno = 0;
13346  const char *__pyx_filename = NULL;
13347  int __pyx_clineno = 0;
13348  if (__pyx_v_info == NULL) {
13349  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
13350  return -1;
13351  }
13352  __Pyx_RefNannySetupContext("__getbuffer__", 0);
13353  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13354  __Pyx_GIVEREF(__pyx_v_info->obj);
13355 
13356  /* "View.MemoryView":519
13357  * @cname('getbuffer')
13358  * def __getbuffer__(self, Py_buffer *info, int flags):
13359  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13360  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13361  *
13362  */
13363  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13364  if (__pyx_t_2) {
13365  } else {
13366  __pyx_t_1 = __pyx_t_2;
13367  goto __pyx_L4_bool_binop_done;
13368  }
13369  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13370  __pyx_t_1 = __pyx_t_2;
13371  __pyx_L4_bool_binop_done:;
13372  if (unlikely(__pyx_t_1)) {
13373 
13374  /* "View.MemoryView":520
13375  * def __getbuffer__(self, Py_buffer *info, int flags):
13376  * if flags & PyBUF_WRITABLE and self.view.readonly:
13377  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
13378  *
13379  * if flags & PyBUF_ND:
13380  */
13381  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
13382  __Pyx_GOTREF(__pyx_t_3);
13383  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13384  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13385  __PYX_ERR(1, 520, __pyx_L1_error)
13386 
13387  /* "View.MemoryView":519
13388  * @cname('getbuffer')
13389  * def __getbuffer__(self, Py_buffer *info, int flags):
13390  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13391  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13392  *
13393  */
13394  }
13395 
13396  /* "View.MemoryView":522
13397  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13398  *
13399  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13400  * info.shape = self.view.shape
13401  * else:
13402  */
13403  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
13404  if (__pyx_t_1) {
13405 
13406  /* "View.MemoryView":523
13407  *
13408  * if flags & PyBUF_ND:
13409  * info.shape = self.view.shape # <<<<<<<<<<<<<<
13410  * else:
13411  * info.shape = NULL
13412  */
13413  __pyx_t_4 = __pyx_v_self->view.shape;
13414  __pyx_v_info->shape = __pyx_t_4;
13415 
13416  /* "View.MemoryView":522
13417  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13418  *
13419  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13420  * info.shape = self.view.shape
13421  * else:
13422  */
13423  goto __pyx_L6;
13424  }
13425 
13426  /* "View.MemoryView":525
13427  * info.shape = self.view.shape
13428  * else:
13429  * info.shape = NULL # <<<<<<<<<<<<<<
13430  *
13431  * if flags & PyBUF_STRIDES:
13432  */
13433  /*else*/ {
13434  __pyx_v_info->shape = NULL;
13435  }
13436  __pyx_L6:;
13437 
13438  /* "View.MemoryView":527
13439  * info.shape = NULL
13440  *
13441  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13442  * info.strides = self.view.strides
13443  * else:
13444  */
13445  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13446  if (__pyx_t_1) {
13447 
13448  /* "View.MemoryView":528
13449  *
13450  * if flags & PyBUF_STRIDES:
13451  * info.strides = self.view.strides # <<<<<<<<<<<<<<
13452  * else:
13453  * info.strides = NULL
13454  */
13455  __pyx_t_4 = __pyx_v_self->view.strides;
13456  __pyx_v_info->strides = __pyx_t_4;
13457 
13458  /* "View.MemoryView":527
13459  * info.shape = NULL
13460  *
13461  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13462  * info.strides = self.view.strides
13463  * else:
13464  */
13465  goto __pyx_L7;
13466  }
13467 
13468  /* "View.MemoryView":530
13469  * info.strides = self.view.strides
13470  * else:
13471  * info.strides = NULL # <<<<<<<<<<<<<<
13472  *
13473  * if flags & PyBUF_INDIRECT:
13474  */
13475  /*else*/ {
13476  __pyx_v_info->strides = NULL;
13477  }
13478  __pyx_L7:;
13479 
13480  /* "View.MemoryView":532
13481  * info.strides = NULL
13482  *
13483  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13484  * info.suboffsets = self.view.suboffsets
13485  * else:
13486  */
13487  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13488  if (__pyx_t_1) {
13489 
13490  /* "View.MemoryView":533
13491  *
13492  * if flags & PyBUF_INDIRECT:
13493  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
13494  * else:
13495  * info.suboffsets = NULL
13496  */
13497  __pyx_t_4 = __pyx_v_self->view.suboffsets;
13498  __pyx_v_info->suboffsets = __pyx_t_4;
13499 
13500  /* "View.MemoryView":532
13501  * info.strides = NULL
13502  *
13503  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13504  * info.suboffsets = self.view.suboffsets
13505  * else:
13506  */
13507  goto __pyx_L8;
13508  }
13509 
13510  /* "View.MemoryView":535
13511  * info.suboffsets = self.view.suboffsets
13512  * else:
13513  * info.suboffsets = NULL # <<<<<<<<<<<<<<
13514  *
13515  * if flags & PyBUF_FORMAT:
13516  */
13517  /*else*/ {
13518  __pyx_v_info->suboffsets = NULL;
13519  }
13520  __pyx_L8:;
13521 
13522  /* "View.MemoryView":537
13523  * info.suboffsets = NULL
13524  *
13525  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13526  * info.format = self.view.format
13527  * else:
13528  */
13529  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13530  if (__pyx_t_1) {
13531 
13532  /* "View.MemoryView":538
13533  *
13534  * if flags & PyBUF_FORMAT:
13535  * info.format = self.view.format # <<<<<<<<<<<<<<
13536  * else:
13537  * info.format = NULL
13538  */
13539  __pyx_t_5 = __pyx_v_self->view.format;
13540  __pyx_v_info->format = __pyx_t_5;
13541 
13542  /* "View.MemoryView":537
13543  * info.suboffsets = NULL
13544  *
13545  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13546  * info.format = self.view.format
13547  * else:
13548  */
13549  goto __pyx_L9;
13550  }
13551 
13552  /* "View.MemoryView":540
13553  * info.format = self.view.format
13554  * else:
13555  * info.format = NULL # <<<<<<<<<<<<<<
13556  *
13557  * info.buf = self.view.buf
13558  */
13559  /*else*/ {
13560  __pyx_v_info->format = NULL;
13561  }
13562  __pyx_L9:;
13563 
13564  /* "View.MemoryView":542
13565  * info.format = NULL
13566  *
13567  * info.buf = self.view.buf # <<<<<<<<<<<<<<
13568  * info.ndim = self.view.ndim
13569  * info.itemsize = self.view.itemsize
13570  */
13571  __pyx_t_6 = __pyx_v_self->view.buf;
13572  __pyx_v_info->buf = __pyx_t_6;
13573 
13574  /* "View.MemoryView":543
13575  *
13576  * info.buf = self.view.buf
13577  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13578  * info.itemsize = self.view.itemsize
13579  * info.len = self.view.len
13580  */
13581  __pyx_t_7 = __pyx_v_self->view.ndim;
13582  __pyx_v_info->ndim = __pyx_t_7;
13583 
13584  /* "View.MemoryView":544
13585  * info.buf = self.view.buf
13586  * info.ndim = self.view.ndim
13587  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13588  * info.len = self.view.len
13589  * info.readonly = self.view.readonly
13590  */
13591  __pyx_t_8 = __pyx_v_self->view.itemsize;
13592  __pyx_v_info->itemsize = __pyx_t_8;
13593 
13594  /* "View.MemoryView":545
13595  * info.ndim = self.view.ndim
13596  * info.itemsize = self.view.itemsize
13597  * info.len = self.view.len # <<<<<<<<<<<<<<
13598  * info.readonly = self.view.readonly
13599  * info.obj = self
13600  */
13601  __pyx_t_8 = __pyx_v_self->view.len;
13602  __pyx_v_info->len = __pyx_t_8;
13603 
13604  /* "View.MemoryView":546
13605  * info.itemsize = self.view.itemsize
13606  * info.len = self.view.len
13607  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13608  * info.obj = self
13609  *
13610  */
13611  __pyx_t_1 = __pyx_v_self->view.readonly;
13612  __pyx_v_info->readonly = __pyx_t_1;
13613 
13614  /* "View.MemoryView":547
13615  * info.len = self.view.len
13616  * info.readonly = self.view.readonly
13617  * info.obj = self # <<<<<<<<<<<<<<
13618  *
13619  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13620  */
13621  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13622  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13623  __Pyx_GOTREF(__pyx_v_info->obj);
13624  __Pyx_DECREF(__pyx_v_info->obj);
13625  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13626 
13627  /* "View.MemoryView":518
13628  *
13629  * @cname('getbuffer')
13630  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13631  * if flags & PyBUF_WRITABLE and self.view.readonly:
13632  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13633  */
13634 
13635  /* function exit code */
13636  __pyx_r = 0;
13637  goto __pyx_L0;
13638  __pyx_L1_error:;
13639  __Pyx_XDECREF(__pyx_t_3);
13640  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13641  __pyx_r = -1;
13642  if (__pyx_v_info->obj != NULL) {
13643  __Pyx_GOTREF(__pyx_v_info->obj);
13644  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13645  }
13646  goto __pyx_L2;
13647  __pyx_L0:;
13648  if (__pyx_v_info->obj == Py_None) {
13649  __Pyx_GOTREF(__pyx_v_info->obj);
13650  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13651  }
13652  __pyx_L2:;
13653  __Pyx_RefNannyFinishContext();
13654  return __pyx_r;
13655 }
13656 
13657 /* "View.MemoryView":553
13658  *
13659  * @property
13660  * def T(self): # <<<<<<<<<<<<<<
13661  * cdef _memoryviewslice result = memoryview_copy(self)
13662  * transpose_memslice(&result.from_slice)
13663  */
13664 
13665 /* Python wrapper */
13666 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13667 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13668  PyObject *__pyx_r = 0;
13669  __Pyx_RefNannyDeclarations
13670  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13671  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13672 
13673  /* function exit code */
13674  __Pyx_RefNannyFinishContext();
13675  return __pyx_r;
13676 }
13677 
13678 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13679  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13680  PyObject *__pyx_r = NULL;
13681  __Pyx_RefNannyDeclarations
13682  PyObject *__pyx_t_1 = NULL;
13683  int __pyx_t_2;
13684  int __pyx_lineno = 0;
13685  const char *__pyx_filename = NULL;
13686  int __pyx_clineno = 0;
13687  __Pyx_RefNannySetupContext("__get__", 0);
13688 
13689  /* "View.MemoryView":554
13690  * @property
13691  * def T(self):
13692  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13693  * transpose_memslice(&result.from_slice)
13694  * return result
13695  */
13696  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
13697  __Pyx_GOTREF(__pyx_t_1);
13698  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
13699  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13700  __pyx_t_1 = 0;
13701 
13702  /* "View.MemoryView":555
13703  * def T(self):
13704  * cdef _memoryviewslice result = memoryview_copy(self)
13705  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13706  * return result
13707  *
13708  */
13709  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
13710 
13711  /* "View.MemoryView":556
13712  * cdef _memoryviewslice result = memoryview_copy(self)
13713  * transpose_memslice(&result.from_slice)
13714  * return result # <<<<<<<<<<<<<<
13715  *
13716  * @property
13717  */
13718  __Pyx_XDECREF(__pyx_r);
13719  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13720  __pyx_r = ((PyObject *)__pyx_v_result);
13721  goto __pyx_L0;
13722 
13723  /* "View.MemoryView":553
13724  *
13725  * @property
13726  * def T(self): # <<<<<<<<<<<<<<
13727  * cdef _memoryviewslice result = memoryview_copy(self)
13728  * transpose_memslice(&result.from_slice)
13729  */
13730 
13731  /* function exit code */
13732  __pyx_L1_error:;
13733  __Pyx_XDECREF(__pyx_t_1);
13734  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13735  __pyx_r = NULL;
13736  __pyx_L0:;
13737  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13738  __Pyx_XGIVEREF(__pyx_r);
13739  __Pyx_RefNannyFinishContext();
13740  return __pyx_r;
13741 }
13742 
13743 /* "View.MemoryView":559
13744  *
13745  * @property
13746  * def base(self): # <<<<<<<<<<<<<<
13747  * return self.obj
13748  *
13749  */
13750 
13751 /* Python wrapper */
13752 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
13753 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13754  PyObject *__pyx_r = 0;
13755  __Pyx_RefNannyDeclarations
13756  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13757  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13758 
13759  /* function exit code */
13760  __Pyx_RefNannyFinishContext();
13761  return __pyx_r;
13762 }
13763 
13764 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13765  PyObject *__pyx_r = NULL;
13766  __Pyx_RefNannyDeclarations
13767  __Pyx_RefNannySetupContext("__get__", 0);
13768 
13769  /* "View.MemoryView":560
13770  * @property
13771  * def base(self):
13772  * return self.obj # <<<<<<<<<<<<<<
13773  *
13774  * @property
13775  */
13776  __Pyx_XDECREF(__pyx_r);
13777  __Pyx_INCREF(__pyx_v_self->obj);
13778  __pyx_r = __pyx_v_self->obj;
13779  goto __pyx_L0;
13780 
13781  /* "View.MemoryView":559
13782  *
13783  * @property
13784  * def base(self): # <<<<<<<<<<<<<<
13785  * return self.obj
13786  *
13787  */
13788 
13789  /* function exit code */
13790  __pyx_L0:;
13791  __Pyx_XGIVEREF(__pyx_r);
13792  __Pyx_RefNannyFinishContext();
13793  return __pyx_r;
13794 }
13795 
13796 /* "View.MemoryView":563
13797  *
13798  * @property
13799  * def shape(self): # <<<<<<<<<<<<<<
13800  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13801  *
13802  */
13803 
13804 /* Python wrapper */
13805 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
13806 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13807  PyObject *__pyx_r = 0;
13808  __Pyx_RefNannyDeclarations
13809  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13810  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13811 
13812  /* function exit code */
13813  __Pyx_RefNannyFinishContext();
13814  return __pyx_r;
13815 }
13816 
13817 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13818  Py_ssize_t __pyx_v_length;
13819  PyObject *__pyx_r = NULL;
13820  __Pyx_RefNannyDeclarations
13821  PyObject *__pyx_t_1 = NULL;
13822  Py_ssize_t *__pyx_t_2;
13823  Py_ssize_t *__pyx_t_3;
13824  Py_ssize_t *__pyx_t_4;
13825  PyObject *__pyx_t_5 = NULL;
13826  int __pyx_lineno = 0;
13827  const char *__pyx_filename = NULL;
13828  int __pyx_clineno = 0;
13829  __Pyx_RefNannySetupContext("__get__", 0);
13830 
13831  /* "View.MemoryView":564
13832  * @property
13833  * def shape(self):
13834  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
13835  *
13836  * @property
13837  */
13838  __Pyx_XDECREF(__pyx_r);
13839  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
13840  __Pyx_GOTREF(__pyx_t_1);
13841  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13842  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13843  __pyx_t_2 = __pyx_t_4;
13844  __pyx_v_length = (__pyx_t_2[0]);
13845  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13846  __Pyx_GOTREF(__pyx_t_5);
13847  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
13848  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13849  }
13850  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13851  __Pyx_GOTREF(__pyx_t_5);
13852  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13853  __pyx_r = __pyx_t_5;
13854  __pyx_t_5 = 0;
13855  goto __pyx_L0;
13856 
13857  /* "View.MemoryView":563
13858  *
13859  * @property
13860  * def shape(self): # <<<<<<<<<<<<<<
13861  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13862  *
13863  */
13864 
13865  /* function exit code */
13866  __pyx_L1_error:;
13867  __Pyx_XDECREF(__pyx_t_1);
13868  __Pyx_XDECREF(__pyx_t_5);
13869  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13870  __pyx_r = NULL;
13871  __pyx_L0:;
13872  __Pyx_XGIVEREF(__pyx_r);
13873  __Pyx_RefNannyFinishContext();
13874  return __pyx_r;
13875 }
13876 
13877 /* "View.MemoryView":567
13878  *
13879  * @property
13880  * def strides(self): # <<<<<<<<<<<<<<
13881  * if self.view.strides == NULL:
13882  *
13883  */
13884 
13885 /* Python wrapper */
13886 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13887 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13888  PyObject *__pyx_r = 0;
13889  __Pyx_RefNannyDeclarations
13890  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13891  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13892 
13893  /* function exit code */
13894  __Pyx_RefNannyFinishContext();
13895  return __pyx_r;
13896 }
13897 
13898 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13899  Py_ssize_t __pyx_v_stride;
13900  PyObject *__pyx_r = NULL;
13901  __Pyx_RefNannyDeclarations
13902  int __pyx_t_1;
13903  PyObject *__pyx_t_2 = NULL;
13904  Py_ssize_t *__pyx_t_3;
13905  Py_ssize_t *__pyx_t_4;
13906  Py_ssize_t *__pyx_t_5;
13907  PyObject *__pyx_t_6 = NULL;
13908  int __pyx_lineno = 0;
13909  const char *__pyx_filename = NULL;
13910  int __pyx_clineno = 0;
13911  __Pyx_RefNannySetupContext("__get__", 0);
13912 
13913  /* "View.MemoryView":568
13914  * @property
13915  * def strides(self):
13916  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13917  *
13918  * raise ValueError("Buffer view does not expose strides")
13919  */
13920  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13921  if (unlikely(__pyx_t_1)) {
13922 
13923  /* "View.MemoryView":570
13924  * if self.view.strides == NULL:
13925  *
13926  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13927  *
13928  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13929  */
13930  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
13931  __Pyx_GOTREF(__pyx_t_2);
13932  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13933  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13934  __PYX_ERR(1, 570, __pyx_L1_error)
13935 
13936  /* "View.MemoryView":568
13937  * @property
13938  * def strides(self):
13939  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13940  *
13941  * raise ValueError("Buffer view does not expose strides")
13942  */
13943  }
13944 
13945  /* "View.MemoryView":572
13946  * raise ValueError("Buffer view does not expose strides")
13947  *
13948  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13949  *
13950  * @property
13951  */
13952  __Pyx_XDECREF(__pyx_r);
13953  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13954  __Pyx_GOTREF(__pyx_t_2);
13955  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13956  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13957  __pyx_t_3 = __pyx_t_5;
13958  __pyx_v_stride = (__pyx_t_3[0]);
13959  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13960  __Pyx_GOTREF(__pyx_t_6);
13961  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13962  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13963  }
13964  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13965  __Pyx_GOTREF(__pyx_t_6);
13966  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13967  __pyx_r = __pyx_t_6;
13968  __pyx_t_6 = 0;
13969  goto __pyx_L0;
13970 
13971  /* "View.MemoryView":567
13972  *
13973  * @property
13974  * def strides(self): # <<<<<<<<<<<<<<
13975  * if self.view.strides == NULL:
13976  *
13977  */
13978 
13979  /* function exit code */
13980  __pyx_L1_error:;
13981  __Pyx_XDECREF(__pyx_t_2);
13982  __Pyx_XDECREF(__pyx_t_6);
13983  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13984  __pyx_r = NULL;
13985  __pyx_L0:;
13986  __Pyx_XGIVEREF(__pyx_r);
13987  __Pyx_RefNannyFinishContext();
13988  return __pyx_r;
13989 }
13990 
13991 /* "View.MemoryView":575
13992  *
13993  * @property
13994  * def suboffsets(self): # <<<<<<<<<<<<<<
13995  * if self.view.suboffsets == NULL:
13996  * return (-1,) * self.view.ndim
13997  */
13998 
13999 /* Python wrapper */
14000 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
14001 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
14002  PyObject *__pyx_r = 0;
14003  __Pyx_RefNannyDeclarations
14004  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14005  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14006 
14007  /* function exit code */
14008  __Pyx_RefNannyFinishContext();
14009  return __pyx_r;
14010 }
14011 
14012 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14013  Py_ssize_t __pyx_v_suboffset;
14014  PyObject *__pyx_r = NULL;
14015  __Pyx_RefNannyDeclarations
14016  int __pyx_t_1;
14017  PyObject *__pyx_t_2 = NULL;
14018  PyObject *__pyx_t_3 = NULL;
14019  Py_ssize_t *__pyx_t_4;
14020  Py_ssize_t *__pyx_t_5;
14021  Py_ssize_t *__pyx_t_6;
14022  int __pyx_lineno = 0;
14023  const char *__pyx_filename = NULL;
14024  int __pyx_clineno = 0;
14025  __Pyx_RefNannySetupContext("__get__", 0);
14026 
14027  /* "View.MemoryView":576
14028  * @property
14029  * def suboffsets(self):
14030  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
14031  * return (-1,) * self.view.ndim
14032  *
14033  */
14034  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
14035  if (__pyx_t_1) {
14036 
14037  /* "View.MemoryView":577
14038  * def suboffsets(self):
14039  * if self.view.suboffsets == NULL:
14040  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
14041  *
14042  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
14043  */
14044  __Pyx_XDECREF(__pyx_r);
14045  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
14046  __Pyx_GOTREF(__pyx_t_2);
14047  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__21, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
14048  __Pyx_GOTREF(__pyx_t_3);
14049  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14050  __pyx_r = __pyx_t_3;
14051  __pyx_t_3 = 0;
14052  goto __pyx_L0;
14053 
14054  /* "View.MemoryView":576
14055  * @property
14056  * def suboffsets(self):
14057  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
14058  * return (-1,) * self.view.ndim
14059  *
14060  */
14061  }
14062 
14063  /* "View.MemoryView":579
14064  * return (-1,) * self.view.ndim
14065  *
14066  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
14067  *
14068  * @property
14069  */
14070  __Pyx_XDECREF(__pyx_r);
14071  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
14072  __Pyx_GOTREF(__pyx_t_3);
14073  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
14074  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
14075  __pyx_t_4 = __pyx_t_6;
14076  __pyx_v_suboffset = (__pyx_t_4[0]);
14077  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
14078  __Pyx_GOTREF(__pyx_t_2);
14079  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
14080  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14081  }
14082  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
14083  __Pyx_GOTREF(__pyx_t_2);
14084  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14085  __pyx_r = __pyx_t_2;
14086  __pyx_t_2 = 0;
14087  goto __pyx_L0;
14088 
14089  /* "View.MemoryView":575
14090  *
14091  * @property
14092  * def suboffsets(self): # <<<<<<<<<<<<<<
14093  * if self.view.suboffsets == NULL:
14094  * return (-1,) * self.view.ndim
14095  */
14096 
14097  /* function exit code */
14098  __pyx_L1_error:;
14099  __Pyx_XDECREF(__pyx_t_2);
14100  __Pyx_XDECREF(__pyx_t_3);
14101  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14102  __pyx_r = NULL;
14103  __pyx_L0:;
14104  __Pyx_XGIVEREF(__pyx_r);
14105  __Pyx_RefNannyFinishContext();
14106  return __pyx_r;
14107 }
14108 
14109 /* "View.MemoryView":582
14110  *
14111  * @property
14112  * def ndim(self): # <<<<<<<<<<<<<<
14113  * return self.view.ndim
14114  *
14115  */
14116 
14117 /* Python wrapper */
14118 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
14119 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
14120  PyObject *__pyx_r = 0;
14121  __Pyx_RefNannyDeclarations
14122  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14123  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14124 
14125  /* function exit code */
14126  __Pyx_RefNannyFinishContext();
14127  return __pyx_r;
14128 }
14129 
14130 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14131  PyObject *__pyx_r = NULL;
14132  __Pyx_RefNannyDeclarations
14133  PyObject *__pyx_t_1 = NULL;
14134  int __pyx_lineno = 0;
14135  const char *__pyx_filename = NULL;
14136  int __pyx_clineno = 0;
14137  __Pyx_RefNannySetupContext("__get__", 0);
14138 
14139  /* "View.MemoryView":583
14140  * @property
14141  * def ndim(self):
14142  * return self.view.ndim # <<<<<<<<<<<<<<
14143  *
14144  * @property
14145  */
14146  __Pyx_XDECREF(__pyx_r);
14147  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
14148  __Pyx_GOTREF(__pyx_t_1);
14149  __pyx_r = __pyx_t_1;
14150  __pyx_t_1 = 0;
14151  goto __pyx_L0;
14152 
14153  /* "View.MemoryView":582
14154  *
14155  * @property
14156  * def ndim(self): # <<<<<<<<<<<<<<
14157  * return self.view.ndim
14158  *
14159  */
14160 
14161  /* function exit code */
14162  __pyx_L1_error:;
14163  __Pyx_XDECREF(__pyx_t_1);
14164  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14165  __pyx_r = NULL;
14166  __pyx_L0:;
14167  __Pyx_XGIVEREF(__pyx_r);
14168  __Pyx_RefNannyFinishContext();
14169  return __pyx_r;
14170 }
14171 
14172 /* "View.MemoryView":586
14173  *
14174  * @property
14175  * def itemsize(self): # <<<<<<<<<<<<<<
14176  * return self.view.itemsize
14177  *
14178  */
14179 
14180 /* Python wrapper */
14181 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
14182 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
14183  PyObject *__pyx_r = 0;
14184  __Pyx_RefNannyDeclarations
14185  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14186  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14187 
14188  /* function exit code */
14189  __Pyx_RefNannyFinishContext();
14190  return __pyx_r;
14191 }
14192 
14193 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14194  PyObject *__pyx_r = NULL;
14195  __Pyx_RefNannyDeclarations
14196  PyObject *__pyx_t_1 = NULL;
14197  int __pyx_lineno = 0;
14198  const char *__pyx_filename = NULL;
14199  int __pyx_clineno = 0;
14200  __Pyx_RefNannySetupContext("__get__", 0);
14201 
14202  /* "View.MemoryView":587
14203  * @property
14204  * def itemsize(self):
14205  * return self.view.itemsize # <<<<<<<<<<<<<<
14206  *
14207  * @property
14208  */
14209  __Pyx_XDECREF(__pyx_r);
14210  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
14211  __Pyx_GOTREF(__pyx_t_1);
14212  __pyx_r = __pyx_t_1;
14213  __pyx_t_1 = 0;
14214  goto __pyx_L0;
14215 
14216  /* "View.MemoryView":586
14217  *
14218  * @property
14219  * def itemsize(self): # <<<<<<<<<<<<<<
14220  * return self.view.itemsize
14221  *
14222  */
14223 
14224  /* function exit code */
14225  __pyx_L1_error:;
14226  __Pyx_XDECREF(__pyx_t_1);
14227  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14228  __pyx_r = NULL;
14229  __pyx_L0:;
14230  __Pyx_XGIVEREF(__pyx_r);
14231  __Pyx_RefNannyFinishContext();
14232  return __pyx_r;
14233 }
14234 
14235 /* "View.MemoryView":590
14236  *
14237  * @property
14238  * def nbytes(self): # <<<<<<<<<<<<<<
14239  * return self.size * self.view.itemsize
14240  *
14241  */
14242 
14243 /* Python wrapper */
14244 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
14245 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
14246  PyObject *__pyx_r = 0;
14247  __Pyx_RefNannyDeclarations
14248  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14249  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14250 
14251  /* function exit code */
14252  __Pyx_RefNannyFinishContext();
14253  return __pyx_r;
14254 }
14255 
14256 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14257  PyObject *__pyx_r = NULL;
14258  __Pyx_RefNannyDeclarations
14259  PyObject *__pyx_t_1 = NULL;
14260  PyObject *__pyx_t_2 = NULL;
14261  PyObject *__pyx_t_3 = NULL;
14262  int __pyx_lineno = 0;
14263  const char *__pyx_filename = NULL;
14264  int __pyx_clineno = 0;
14265  __Pyx_RefNannySetupContext("__get__", 0);
14266 
14267  /* "View.MemoryView":591
14268  * @property
14269  * def nbytes(self):
14270  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
14271  *
14272  * @property
14273  */
14274  __Pyx_XDECREF(__pyx_r);
14275  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
14276  __Pyx_GOTREF(__pyx_t_1);
14277  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
14278  __Pyx_GOTREF(__pyx_t_2);
14279  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
14280  __Pyx_GOTREF(__pyx_t_3);
14281  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14282  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14283  __pyx_r = __pyx_t_3;
14284  __pyx_t_3 = 0;
14285  goto __pyx_L0;
14286 
14287  /* "View.MemoryView":590
14288  *
14289  * @property
14290  * def nbytes(self): # <<<<<<<<<<<<<<
14291  * return self.size * self.view.itemsize
14292  *
14293  */
14294 
14295  /* function exit code */
14296  __pyx_L1_error:;
14297  __Pyx_XDECREF(__pyx_t_1);
14298  __Pyx_XDECREF(__pyx_t_2);
14299  __Pyx_XDECREF(__pyx_t_3);
14300  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14301  __pyx_r = NULL;
14302  __pyx_L0:;
14303  __Pyx_XGIVEREF(__pyx_r);
14304  __Pyx_RefNannyFinishContext();
14305  return __pyx_r;
14306 }
14307 
14308 /* "View.MemoryView":594
14309  *
14310  * @property
14311  * def size(self): # <<<<<<<<<<<<<<
14312  * if self._size is None:
14313  * result = 1
14314  */
14315 
14316 /* Python wrapper */
14317 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
14318 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14319  PyObject *__pyx_r = 0;
14320  __Pyx_RefNannyDeclarations
14321  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14322  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14323 
14324  /* function exit code */
14325  __Pyx_RefNannyFinishContext();
14326  return __pyx_r;
14327 }
14328 
14329 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14330  PyObject *__pyx_v_result = NULL;
14331  PyObject *__pyx_v_length = NULL;
14332  PyObject *__pyx_r = NULL;
14333  __Pyx_RefNannyDeclarations
14334  int __pyx_t_1;
14335  int __pyx_t_2;
14336  Py_ssize_t *__pyx_t_3;
14337  Py_ssize_t *__pyx_t_4;
14338  Py_ssize_t *__pyx_t_5;
14339  PyObject *__pyx_t_6 = NULL;
14340  int __pyx_lineno = 0;
14341  const char *__pyx_filename = NULL;
14342  int __pyx_clineno = 0;
14343  __Pyx_RefNannySetupContext("__get__", 0);
14344 
14345  /* "View.MemoryView":595
14346  * @property
14347  * def size(self):
14348  * if self._size is None: # <<<<<<<<<<<<<<
14349  * result = 1
14350  *
14351  */
14352  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14353  __pyx_t_2 = (__pyx_t_1 != 0);
14354  if (__pyx_t_2) {
14355 
14356  /* "View.MemoryView":596
14357  * def size(self):
14358  * if self._size is None:
14359  * result = 1 # <<<<<<<<<<<<<<
14360  *
14361  * for length in self.view.shape[:self.view.ndim]:
14362  */
14363  __Pyx_INCREF(__pyx_int_1);
14364  __pyx_v_result = __pyx_int_1;
14365 
14366  /* "View.MemoryView":598
14367  * result = 1
14368  *
14369  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
14370  * result *= length
14371  *
14372  */
14373  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14374  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14375  __pyx_t_3 = __pyx_t_5;
14376  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
14377  __Pyx_GOTREF(__pyx_t_6);
14378  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14379  __pyx_t_6 = 0;
14380 
14381  /* "View.MemoryView":599
14382  *
14383  * for length in self.view.shape[:self.view.ndim]:
14384  * result *= length # <<<<<<<<<<<<<<
14385  *
14386  * self._size = result
14387  */
14388  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
14389  __Pyx_GOTREF(__pyx_t_6);
14390  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14391  __pyx_t_6 = 0;
14392  }
14393 
14394  /* "View.MemoryView":601
14395  * result *= length
14396  *
14397  * self._size = result # <<<<<<<<<<<<<<
14398  *
14399  * return self._size
14400  */
14401  __Pyx_INCREF(__pyx_v_result);
14402  __Pyx_GIVEREF(__pyx_v_result);
14403  __Pyx_GOTREF(__pyx_v_self->_size);
14404  __Pyx_DECREF(__pyx_v_self->_size);
14405  __pyx_v_self->_size = __pyx_v_result;
14406 
14407  /* "View.MemoryView":595
14408  * @property
14409  * def size(self):
14410  * if self._size is None: # <<<<<<<<<<<<<<
14411  * result = 1
14412  *
14413  */
14414  }
14415 
14416  /* "View.MemoryView":603
14417  * self._size = result
14418  *
14419  * return self._size # <<<<<<<<<<<<<<
14420  *
14421  * def __len__(self):
14422  */
14423  __Pyx_XDECREF(__pyx_r);
14424  __Pyx_INCREF(__pyx_v_self->_size);
14425  __pyx_r = __pyx_v_self->_size;
14426  goto __pyx_L0;
14427 
14428  /* "View.MemoryView":594
14429  *
14430  * @property
14431  * def size(self): # <<<<<<<<<<<<<<
14432  * if self._size is None:
14433  * result = 1
14434  */
14435 
14436  /* function exit code */
14437  __pyx_L1_error:;
14438  __Pyx_XDECREF(__pyx_t_6);
14439  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14440  __pyx_r = NULL;
14441  __pyx_L0:;
14442  __Pyx_XDECREF(__pyx_v_result);
14443  __Pyx_XDECREF(__pyx_v_length);
14444  __Pyx_XGIVEREF(__pyx_r);
14445  __Pyx_RefNannyFinishContext();
14446  return __pyx_r;
14447 }
14448 
14449 /* "View.MemoryView":605
14450  * return self._size
14451  *
14452  * def __len__(self): # <<<<<<<<<<<<<<
14453  * if self.view.ndim >= 1:
14454  * return self.view.shape[0]
14455  */
14456 
14457 /* Python wrapper */
14458 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
14459 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14460  Py_ssize_t __pyx_r;
14461  __Pyx_RefNannyDeclarations
14462  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14463  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14464 
14465  /* function exit code */
14466  __Pyx_RefNannyFinishContext();
14467  return __pyx_r;
14468 }
14469 
14470 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
14471  Py_ssize_t __pyx_r;
14472  __Pyx_RefNannyDeclarations
14473  int __pyx_t_1;
14474  __Pyx_RefNannySetupContext("__len__", 0);
14475 
14476  /* "View.MemoryView":606
14477  *
14478  * def __len__(self):
14479  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14480  * return self.view.shape[0]
14481  *
14482  */
14483  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14484  if (__pyx_t_1) {
14485 
14486  /* "View.MemoryView":607
14487  * def __len__(self):
14488  * if self.view.ndim >= 1:
14489  * return self.view.shape[0] # <<<<<<<<<<<<<<
14490  *
14491  * return 0
14492  */
14493  __pyx_r = (__pyx_v_self->view.shape[0]);
14494  goto __pyx_L0;
14495 
14496  /* "View.MemoryView":606
14497  *
14498  * def __len__(self):
14499  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14500  * return self.view.shape[0]
14501  *
14502  */
14503  }
14504 
14505  /* "View.MemoryView":609
14506  * return self.view.shape[0]
14507  *
14508  * return 0 # <<<<<<<<<<<<<<
14509  *
14510  * def __repr__(self):
14511  */
14512  __pyx_r = 0;
14513  goto __pyx_L0;
14514 
14515  /* "View.MemoryView":605
14516  * return self._size
14517  *
14518  * def __len__(self): # <<<<<<<<<<<<<<
14519  * if self.view.ndim >= 1:
14520  * return self.view.shape[0]
14521  */
14522 
14523  /* function exit code */
14524  __pyx_L0:;
14525  __Pyx_RefNannyFinishContext();
14526  return __pyx_r;
14527 }
14528 
14529 /* "View.MemoryView":611
14530  * return 0
14531  *
14532  * def __repr__(self): # <<<<<<<<<<<<<<
14533  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14534  * id(self))
14535  */
14536 
14537 /* Python wrapper */
14538 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
14539 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14540  PyObject *__pyx_r = 0;
14541  __Pyx_RefNannyDeclarations
14542  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
14543  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14544 
14545  /* function exit code */
14546  __Pyx_RefNannyFinishContext();
14547  return __pyx_r;
14548 }
14549 
14550 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
14551  PyObject *__pyx_r = NULL;
14552  __Pyx_RefNannyDeclarations
14553  PyObject *__pyx_t_1 = NULL;
14554  PyObject *__pyx_t_2 = NULL;
14555  PyObject *__pyx_t_3 = NULL;
14556  int __pyx_lineno = 0;
14557  const char *__pyx_filename = NULL;
14558  int __pyx_clineno = 0;
14559  __Pyx_RefNannySetupContext("__repr__", 0);
14560 
14561  /* "View.MemoryView":612
14562  *
14563  * def __repr__(self):
14564  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14565  * id(self))
14566  *
14567  */
14568  __Pyx_XDECREF(__pyx_r);
14569  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14570  __Pyx_GOTREF(__pyx_t_1);
14571  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14572  __Pyx_GOTREF(__pyx_t_2);
14573  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14574  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14575  __Pyx_GOTREF(__pyx_t_1);
14576  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14577 
14578  /* "View.MemoryView":613
14579  * def __repr__(self):
14580  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14581  * id(self)) # <<<<<<<<<<<<<<
14582  *
14583  * def __str__(self):
14584  */
14585  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
14586  __Pyx_GOTREF(__pyx_t_2);
14587 
14588  /* "View.MemoryView":612
14589  *
14590  * def __repr__(self):
14591  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14592  * id(self))
14593  *
14594  */
14595  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
14596  __Pyx_GOTREF(__pyx_t_3);
14597  __Pyx_GIVEREF(__pyx_t_1);
14598  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14599  __Pyx_GIVEREF(__pyx_t_2);
14600  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14601  __pyx_t_1 = 0;
14602  __pyx_t_2 = 0;
14603  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14604  __Pyx_GOTREF(__pyx_t_2);
14605  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14606  __pyx_r = __pyx_t_2;
14607  __pyx_t_2 = 0;
14608  goto __pyx_L0;
14609 
14610  /* "View.MemoryView":611
14611  * return 0
14612  *
14613  * def __repr__(self): # <<<<<<<<<<<<<<
14614  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14615  * id(self))
14616  */
14617 
14618  /* function exit code */
14619  __pyx_L1_error:;
14620  __Pyx_XDECREF(__pyx_t_1);
14621  __Pyx_XDECREF(__pyx_t_2);
14622  __Pyx_XDECREF(__pyx_t_3);
14623  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14624  __pyx_r = NULL;
14625  __pyx_L0:;
14626  __Pyx_XGIVEREF(__pyx_r);
14627  __Pyx_RefNannyFinishContext();
14628  return __pyx_r;
14629 }
14630 
14631 /* "View.MemoryView":615
14632  * id(self))
14633  *
14634  * def __str__(self): # <<<<<<<<<<<<<<
14635  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14636  *
14637  */
14638 
14639 /* Python wrapper */
14640 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14641 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14642  PyObject *__pyx_r = 0;
14643  __Pyx_RefNannyDeclarations
14644  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14645  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14646 
14647  /* function exit code */
14648  __Pyx_RefNannyFinishContext();
14649  return __pyx_r;
14650 }
14651 
14652 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14653  PyObject *__pyx_r = NULL;
14654  __Pyx_RefNannyDeclarations
14655  PyObject *__pyx_t_1 = NULL;
14656  PyObject *__pyx_t_2 = NULL;
14657  int __pyx_lineno = 0;
14658  const char *__pyx_filename = NULL;
14659  int __pyx_clineno = 0;
14660  __Pyx_RefNannySetupContext("__str__", 0);
14661 
14662  /* "View.MemoryView":616
14663  *
14664  * def __str__(self):
14665  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14666  *
14667  *
14668  */
14669  __Pyx_XDECREF(__pyx_r);
14670  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14671  __Pyx_GOTREF(__pyx_t_1);
14672  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14673  __Pyx_GOTREF(__pyx_t_2);
14674  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14675  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14676  __Pyx_GOTREF(__pyx_t_1);
14677  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14678  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14679  __Pyx_GOTREF(__pyx_t_2);
14680  __Pyx_GIVEREF(__pyx_t_1);
14681  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14682  __pyx_t_1 = 0;
14683  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14684  __Pyx_GOTREF(__pyx_t_1);
14685  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14686  __pyx_r = __pyx_t_1;
14687  __pyx_t_1 = 0;
14688  goto __pyx_L0;
14689 
14690  /* "View.MemoryView":615
14691  * id(self))
14692  *
14693  * def __str__(self): # <<<<<<<<<<<<<<
14694  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14695  *
14696  */
14697 
14698  /* function exit code */
14699  __pyx_L1_error:;
14700  __Pyx_XDECREF(__pyx_t_1);
14701  __Pyx_XDECREF(__pyx_t_2);
14702  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14703  __pyx_r = NULL;
14704  __pyx_L0:;
14705  __Pyx_XGIVEREF(__pyx_r);
14706  __Pyx_RefNannyFinishContext();
14707  return __pyx_r;
14708 }
14709 
14710 /* "View.MemoryView":619
14711  *
14712  *
14713  * def is_c_contig(self): # <<<<<<<<<<<<<<
14714  * cdef __Pyx_memviewslice *mslice
14715  * cdef __Pyx_memviewslice tmp
14716  */
14717 
14718 /* Python wrapper */
14719 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14720 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14721  PyObject *__pyx_r = 0;
14722  __Pyx_RefNannyDeclarations
14723  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14724  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14725 
14726  /* function exit code */
14727  __Pyx_RefNannyFinishContext();
14728  return __pyx_r;
14729 }
14730 
14731 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14732  __Pyx_memviewslice *__pyx_v_mslice;
14733  __Pyx_memviewslice __pyx_v_tmp;
14734  PyObject *__pyx_r = NULL;
14735  __Pyx_RefNannyDeclarations
14736  __Pyx_memviewslice *__pyx_t_1;
14737  PyObject *__pyx_t_2 = NULL;
14738  int __pyx_lineno = 0;
14739  const char *__pyx_filename = NULL;
14740  int __pyx_clineno = 0;
14741  __Pyx_RefNannySetupContext("is_c_contig", 0);
14742 
14743  /* "View.MemoryView":622
14744  * cdef __Pyx_memviewslice *mslice
14745  * cdef __Pyx_memviewslice tmp
14746  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14747  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14748  *
14749  */
14750  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
14751  __pyx_v_mslice = __pyx_t_1;
14752 
14753  /* "View.MemoryView":623
14754  * cdef __Pyx_memviewslice tmp
14755  * mslice = get_slice_from_memview(self, &tmp)
14756  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14757  *
14758  * def is_f_contig(self):
14759  */
14760  __Pyx_XDECREF(__pyx_r);
14761  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
14762  __Pyx_GOTREF(__pyx_t_2);
14763  __pyx_r = __pyx_t_2;
14764  __pyx_t_2 = 0;
14765  goto __pyx_L0;
14766 
14767  /* "View.MemoryView":619
14768  *
14769  *
14770  * def is_c_contig(self): # <<<<<<<<<<<<<<
14771  * cdef __Pyx_memviewslice *mslice
14772  * cdef __Pyx_memviewslice tmp
14773  */
14774 
14775  /* function exit code */
14776  __pyx_L1_error:;
14777  __Pyx_XDECREF(__pyx_t_2);
14778  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14779  __pyx_r = NULL;
14780  __pyx_L0:;
14781  __Pyx_XGIVEREF(__pyx_r);
14782  __Pyx_RefNannyFinishContext();
14783  return __pyx_r;
14784 }
14785 
14786 /* "View.MemoryView":625
14787  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14788  *
14789  * def is_f_contig(self): # <<<<<<<<<<<<<<
14790  * cdef __Pyx_memviewslice *mslice
14791  * cdef __Pyx_memviewslice tmp
14792  */
14793 
14794 /* Python wrapper */
14795 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14796 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14797  PyObject *__pyx_r = 0;
14798  __Pyx_RefNannyDeclarations
14799  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
14800  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14801 
14802  /* function exit code */
14803  __Pyx_RefNannyFinishContext();
14804  return __pyx_r;
14805 }
14806 
14807 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14808  __Pyx_memviewslice *__pyx_v_mslice;
14809  __Pyx_memviewslice __pyx_v_tmp;
14810  PyObject *__pyx_r = NULL;
14811  __Pyx_RefNannyDeclarations
14812  __Pyx_memviewslice *__pyx_t_1;
14813  PyObject *__pyx_t_2 = NULL;
14814  int __pyx_lineno = 0;
14815  const char *__pyx_filename = NULL;
14816  int __pyx_clineno = 0;
14817  __Pyx_RefNannySetupContext("is_f_contig", 0);
14818 
14819  /* "View.MemoryView":628
14820  * cdef __Pyx_memviewslice *mslice
14821  * cdef __Pyx_memviewslice tmp
14822  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14823  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14824  *
14825  */
14826  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
14827  __pyx_v_mslice = __pyx_t_1;
14828 
14829  /* "View.MemoryView":629
14830  * cdef __Pyx_memviewslice tmp
14831  * mslice = get_slice_from_memview(self, &tmp)
14832  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
14833  *
14834  * def copy(self):
14835  */
14836  __Pyx_XDECREF(__pyx_r);
14837  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
14838  __Pyx_GOTREF(__pyx_t_2);
14839  __pyx_r = __pyx_t_2;
14840  __pyx_t_2 = 0;
14841  goto __pyx_L0;
14842 
14843  /* "View.MemoryView":625
14844  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14845  *
14846  * def is_f_contig(self): # <<<<<<<<<<<<<<
14847  * cdef __Pyx_memviewslice *mslice
14848  * cdef __Pyx_memviewslice tmp
14849  */
14850 
14851  /* function exit code */
14852  __pyx_L1_error:;
14853  __Pyx_XDECREF(__pyx_t_2);
14854  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14855  __pyx_r = NULL;
14856  __pyx_L0:;
14857  __Pyx_XGIVEREF(__pyx_r);
14858  __Pyx_RefNannyFinishContext();
14859  return __pyx_r;
14860 }
14861 
14862 /* "View.MemoryView":631
14863  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14864  *
14865  * def copy(self): # <<<<<<<<<<<<<<
14866  * cdef __Pyx_memviewslice mslice
14867  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14868  */
14869 
14870 /* Python wrapper */
14871 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14872 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14873  PyObject *__pyx_r = 0;
14874  __Pyx_RefNannyDeclarations
14875  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
14876  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
14877 
14878  /* function exit code */
14879  __Pyx_RefNannyFinishContext();
14880  return __pyx_r;
14881 }
14882 
14883 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
14884  __Pyx_memviewslice __pyx_v_mslice;
14885  int __pyx_v_flags;
14886  PyObject *__pyx_r = NULL;
14887  __Pyx_RefNannyDeclarations
14888  __Pyx_memviewslice __pyx_t_1;
14889  PyObject *__pyx_t_2 = NULL;
14890  int __pyx_lineno = 0;
14891  const char *__pyx_filename = NULL;
14892  int __pyx_clineno = 0;
14893  __Pyx_RefNannySetupContext("copy", 0);
14894 
14895  /* "View.MemoryView":633
14896  * def copy(self):
14897  * cdef __Pyx_memviewslice mslice
14898  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
14899  *
14900  * slice_copy(self, &mslice)
14901  */
14902  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14903 
14904  /* "View.MemoryView":635
14905  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14906  *
14907  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
14908  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
14909  * self.view.itemsize,
14910  */
14911  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14912 
14913  /* "View.MemoryView":636
14914  *
14915  * slice_copy(self, &mslice)
14916  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14917  * self.view.itemsize,
14918  * flags|PyBUF_C_CONTIGUOUS,
14919  */
14920  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
14921  __pyx_v_mslice = __pyx_t_1;
14922 
14923  /* "View.MemoryView":641
14924  * self.dtype_is_object)
14925  *
14926  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14927  *
14928  * def copy_fortran(self):
14929  */
14930  __Pyx_XDECREF(__pyx_r);
14931  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
14932  __Pyx_GOTREF(__pyx_t_2);
14933  __pyx_r = __pyx_t_2;
14934  __pyx_t_2 = 0;
14935  goto __pyx_L0;
14936 
14937  /* "View.MemoryView":631
14938  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14939  *
14940  * def copy(self): # <<<<<<<<<<<<<<
14941  * cdef __Pyx_memviewslice mslice
14942  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14943  */
14944 
14945  /* function exit code */
14946  __pyx_L1_error:;
14947  __Pyx_XDECREF(__pyx_t_2);
14948  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14949  __pyx_r = NULL;
14950  __pyx_L0:;
14951  __Pyx_XGIVEREF(__pyx_r);
14952  __Pyx_RefNannyFinishContext();
14953  return __pyx_r;
14954 }
14955 
14956 /* "View.MemoryView":643
14957  * return memoryview_copy_from_slice(self, &mslice)
14958  *
14959  * def copy_fortran(self): # <<<<<<<<<<<<<<
14960  * cdef __Pyx_memviewslice src, dst
14961  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14962  */
14963 
14964 /* Python wrapper */
14965 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14966 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14967  PyObject *__pyx_r = 0;
14968  __Pyx_RefNannyDeclarations
14969  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14970  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14971 
14972  /* function exit code */
14973  __Pyx_RefNannyFinishContext();
14974  return __pyx_r;
14975 }
14976 
14977 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14978  __Pyx_memviewslice __pyx_v_src;
14979  __Pyx_memviewslice __pyx_v_dst;
14980  int __pyx_v_flags;
14981  PyObject *__pyx_r = NULL;
14982  __Pyx_RefNannyDeclarations
14983  __Pyx_memviewslice __pyx_t_1;
14984  PyObject *__pyx_t_2 = NULL;
14985  int __pyx_lineno = 0;
14986  const char *__pyx_filename = NULL;
14987  int __pyx_clineno = 0;
14988  __Pyx_RefNannySetupContext("copy_fortran", 0);
14989 
14990  /* "View.MemoryView":645
14991  * def copy_fortran(self):
14992  * cdef __Pyx_memviewslice src, dst
14993  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14994  *
14995  * slice_copy(self, &src)
14996  */
14997  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14998 
14999  /* "View.MemoryView":647
15000  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15001  *
15002  * slice_copy(self, &src) # <<<<<<<<<<<<<<
15003  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
15004  * self.view.itemsize,
15005  */
15006  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
15007 
15008  /* "View.MemoryView":648
15009  *
15010  * slice_copy(self, &src)
15011  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
15012  * self.view.itemsize,
15013  * flags|PyBUF_F_CONTIGUOUS,
15014  */
15015  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
15016  __pyx_v_dst = __pyx_t_1;
15017 
15018  /* "View.MemoryView":653
15019  * self.dtype_is_object)
15020  *
15021  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
15022  *
15023  *
15024  */
15025  __Pyx_XDECREF(__pyx_r);
15026  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
15027  __Pyx_GOTREF(__pyx_t_2);
15028  __pyx_r = __pyx_t_2;
15029  __pyx_t_2 = 0;
15030  goto __pyx_L0;
15031 
15032  /* "View.MemoryView":643
15033  * return memoryview_copy_from_slice(self, &mslice)
15034  *
15035  * def copy_fortran(self): # <<<<<<<<<<<<<<
15036  * cdef __Pyx_memviewslice src, dst
15037  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15038  */
15039 
15040  /* function exit code */
15041  __pyx_L1_error:;
15042  __Pyx_XDECREF(__pyx_t_2);
15043  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
15044  __pyx_r = NULL;
15045  __pyx_L0:;
15046  __Pyx_XGIVEREF(__pyx_r);
15047  __Pyx_RefNannyFinishContext();
15048  return __pyx_r;
15049 }
15050 
15051 /* "(tree fragment)":1
15052  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15053  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15054  * def __setstate_cython__(self, __pyx_state):
15055  */
15056 
15057 /* Python wrapper */
15058 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15059 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15060  PyObject *__pyx_r = 0;
15061  __Pyx_RefNannyDeclarations
15062  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15063  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15064 
15065  /* function exit code */
15066  __Pyx_RefNannyFinishContext();
15067  return __pyx_r;
15068 }
15069 
15070 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
15071  PyObject *__pyx_r = NULL;
15072  __Pyx_RefNannyDeclarations
15073  PyObject *__pyx_t_1 = NULL;
15074  int __pyx_lineno = 0;
15075  const char *__pyx_filename = NULL;
15076  int __pyx_clineno = 0;
15077  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15078 
15079  /* "(tree fragment)":2
15080  * def __reduce_cython__(self):
15081  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15082  * def __setstate_cython__(self, __pyx_state):
15083  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15084  */
15085  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
15086  __Pyx_GOTREF(__pyx_t_1);
15087  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15088  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15089  __PYX_ERR(1, 2, __pyx_L1_error)
15090 
15091  /* "(tree fragment)":1
15092  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15093  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15094  * def __setstate_cython__(self, __pyx_state):
15095  */
15096 
15097  /* function exit code */
15098  __pyx_L1_error:;
15099  __Pyx_XDECREF(__pyx_t_1);
15100  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15101  __pyx_r = NULL;
15102  __Pyx_XGIVEREF(__pyx_r);
15103  __Pyx_RefNannyFinishContext();
15104  return __pyx_r;
15105 }
15106 
15107 /* "(tree fragment)":3
15108  * def __reduce_cython__(self):
15109  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15110  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15111  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15112  */
15113 
15114 /* Python wrapper */
15115 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
15116 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15117  PyObject *__pyx_r = 0;
15118  __Pyx_RefNannyDeclarations
15119  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15120  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15121 
15122  /* function exit code */
15123  __Pyx_RefNannyFinishContext();
15124  return __pyx_r;
15125 }
15126 
15127 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15128  PyObject *__pyx_r = NULL;
15129  __Pyx_RefNannyDeclarations
15130  PyObject *__pyx_t_1 = NULL;
15131  int __pyx_lineno = 0;
15132  const char *__pyx_filename = NULL;
15133  int __pyx_clineno = 0;
15134  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15135 
15136  /* "(tree fragment)":4
15137  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15138  * def __setstate_cython__(self, __pyx_state):
15139  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15140  */
15141  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
15142  __Pyx_GOTREF(__pyx_t_1);
15143  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15144  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15145  __PYX_ERR(1, 4, __pyx_L1_error)
15146 
15147  /* "(tree fragment)":3
15148  * def __reduce_cython__(self):
15149  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15150  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15151  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15152  */
15153 
15154  /* function exit code */
15155  __pyx_L1_error:;
15156  __Pyx_XDECREF(__pyx_t_1);
15157  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15158  __pyx_r = NULL;
15159  __Pyx_XGIVEREF(__pyx_r);
15160  __Pyx_RefNannyFinishContext();
15161  return __pyx_r;
15162 }
15163 
15164 /* "View.MemoryView":657
15165  *
15166  * @cname('__pyx_memoryview_new')
15167  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15168  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15169  * result.typeinfo = typeinfo
15170  */
15171 
15172 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
15173  struct __pyx_memoryview_obj *__pyx_v_result = 0;
15174  PyObject *__pyx_r = NULL;
15175  __Pyx_RefNannyDeclarations
15176  PyObject *__pyx_t_1 = NULL;
15177  PyObject *__pyx_t_2 = NULL;
15178  PyObject *__pyx_t_3 = NULL;
15179  int __pyx_lineno = 0;
15180  const char *__pyx_filename = NULL;
15181  int __pyx_clineno = 0;
15182  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
15183 
15184  /* "View.MemoryView":658
15185  * @cname('__pyx_memoryview_new')
15186  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15187  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
15188  * result.typeinfo = typeinfo
15189  * return result
15190  */
15191  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
15192  __Pyx_GOTREF(__pyx_t_1);
15193  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
15194  __Pyx_GOTREF(__pyx_t_2);
15195  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
15196  __Pyx_GOTREF(__pyx_t_3);
15197  __Pyx_INCREF(__pyx_v_o);
15198  __Pyx_GIVEREF(__pyx_v_o);
15199  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
15200  __Pyx_GIVEREF(__pyx_t_1);
15201  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
15202  __Pyx_GIVEREF(__pyx_t_2);
15203  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15204  __pyx_t_1 = 0;
15205  __pyx_t_2 = 0;
15206  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
15207  __Pyx_GOTREF(__pyx_t_2);
15208  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15209  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
15210  __pyx_t_2 = 0;
15211 
15212  /* "View.MemoryView":659
15213  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15214  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15215  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
15216  * return result
15217  *
15218  */
15219  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15220 
15221  /* "View.MemoryView":660
15222  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15223  * result.typeinfo = typeinfo
15224  * return result # <<<<<<<<<<<<<<
15225  *
15226  * @cname('__pyx_memoryview_check')
15227  */
15228  __Pyx_XDECREF(__pyx_r);
15229  __Pyx_INCREF(((PyObject *)__pyx_v_result));
15230  __pyx_r = ((PyObject *)__pyx_v_result);
15231  goto __pyx_L0;
15232 
15233  /* "View.MemoryView":657
15234  *
15235  * @cname('__pyx_memoryview_new')
15236  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15237  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15238  * result.typeinfo = typeinfo
15239  */
15240 
15241  /* function exit code */
15242  __pyx_L1_error:;
15243  __Pyx_XDECREF(__pyx_t_1);
15244  __Pyx_XDECREF(__pyx_t_2);
15245  __Pyx_XDECREF(__pyx_t_3);
15246  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15247  __pyx_r = 0;
15248  __pyx_L0:;
15249  __Pyx_XDECREF((PyObject *)__pyx_v_result);
15250  __Pyx_XGIVEREF(__pyx_r);
15251  __Pyx_RefNannyFinishContext();
15252  return __pyx_r;
15253 }
15254 
15255 /* "View.MemoryView":663
15256  *
15257  * @cname('__pyx_memoryview_check')
15258  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15259  * return isinstance(o, memoryview)
15260  *
15261  */
15262 
15263 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15264  int __pyx_r;
15265  __Pyx_RefNannyDeclarations
15266  int __pyx_t_1;
15267  __Pyx_RefNannySetupContext("memoryview_check", 0);
15268 
15269  /* "View.MemoryView":664
15270  * @cname('__pyx_memoryview_check')
15271  * cdef inline bint memoryview_check(object o):
15272  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
15273  *
15274  * cdef tuple _unellipsify(object index, int ndim):
15275  */
15276  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15277  __pyx_r = __pyx_t_1;
15278  goto __pyx_L0;
15279 
15280  /* "View.MemoryView":663
15281  *
15282  * @cname('__pyx_memoryview_check')
15283  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15284  * return isinstance(o, memoryview)
15285  *
15286  */
15287 
15288  /* function exit code */
15289  __pyx_L0:;
15290  __Pyx_RefNannyFinishContext();
15291  return __pyx_r;
15292 }
15293 
15294 /* "View.MemoryView":666
15295  * return isinstance(o, memoryview)
15296  *
15297  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15298  * """
15299  * Replace all ellipses with full slices and fill incomplete indices with
15300  */
15301 
15302 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
15303  PyObject *__pyx_v_tup = NULL;
15304  PyObject *__pyx_v_result = NULL;
15305  int __pyx_v_have_slices;
15306  int __pyx_v_seen_ellipsis;
15307  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15308  PyObject *__pyx_v_item = NULL;
15309  Py_ssize_t __pyx_v_nslices;
15310  PyObject *__pyx_r = NULL;
15311  __Pyx_RefNannyDeclarations
15312  int __pyx_t_1;
15313  int __pyx_t_2;
15314  PyObject *__pyx_t_3 = NULL;
15315  PyObject *__pyx_t_4 = NULL;
15316  Py_ssize_t __pyx_t_5;
15317  PyObject *(*__pyx_t_6)(PyObject *);
15318  PyObject *__pyx_t_7 = NULL;
15319  Py_ssize_t __pyx_t_8;
15320  int __pyx_t_9;
15321  int __pyx_t_10;
15322  PyObject *__pyx_t_11 = NULL;
15323  int __pyx_lineno = 0;
15324  const char *__pyx_filename = NULL;
15325  int __pyx_clineno = 0;
15326  __Pyx_RefNannySetupContext("_unellipsify", 0);
15327 
15328  /* "View.MemoryView":671
15329  * full slices.
15330  * """
15331  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15332  * tup = (index,)
15333  * else:
15334  */
15335  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15336  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15337  if (__pyx_t_2) {
15338 
15339  /* "View.MemoryView":672
15340  * """
15341  * if not isinstance(index, tuple):
15342  * tup = (index,) # <<<<<<<<<<<<<<
15343  * else:
15344  * tup = index
15345  */
15346  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
15347  __Pyx_GOTREF(__pyx_t_3);
15348  __Pyx_INCREF(__pyx_v_index);
15349  __Pyx_GIVEREF(__pyx_v_index);
15350  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15351  __pyx_v_tup = __pyx_t_3;
15352  __pyx_t_3 = 0;
15353 
15354  /* "View.MemoryView":671
15355  * full slices.
15356  * """
15357  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15358  * tup = (index,)
15359  * else:
15360  */
15361  goto __pyx_L3;
15362  }
15363 
15364  /* "View.MemoryView":674
15365  * tup = (index,)
15366  * else:
15367  * tup = index # <<<<<<<<<<<<<<
15368  *
15369  * result = []
15370  */
15371  /*else*/ {
15372  __Pyx_INCREF(__pyx_v_index);
15373  __pyx_v_tup = __pyx_v_index;
15374  }
15375  __pyx_L3:;
15376 
15377  /* "View.MemoryView":676
15378  * tup = index
15379  *
15380  * result = [] # <<<<<<<<<<<<<<
15381  * have_slices = False
15382  * seen_ellipsis = False
15383  */
15384  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
15385  __Pyx_GOTREF(__pyx_t_3);
15386  __pyx_v_result = ((PyObject*)__pyx_t_3);
15387  __pyx_t_3 = 0;
15388 
15389  /* "View.MemoryView":677
15390  *
15391  * result = []
15392  * have_slices = False # <<<<<<<<<<<<<<
15393  * seen_ellipsis = False
15394  * for idx, item in enumerate(tup):
15395  */
15396  __pyx_v_have_slices = 0;
15397 
15398  /* "View.MemoryView":678
15399  * result = []
15400  * have_slices = False
15401  * seen_ellipsis = False # <<<<<<<<<<<<<<
15402  * for idx, item in enumerate(tup):
15403  * if item is Ellipsis:
15404  */
15405  __pyx_v_seen_ellipsis = 0;
15406 
15407  /* "View.MemoryView":679
15408  * have_slices = False
15409  * seen_ellipsis = False
15410  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15411  * if item is Ellipsis:
15412  * if not seen_ellipsis:
15413  */
15414  __Pyx_INCREF(__pyx_int_0);
15415  __pyx_t_3 = __pyx_int_0;
15416  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15417  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15418  __pyx_t_6 = NULL;
15419  } else {
15420  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
15421  __Pyx_GOTREF(__pyx_t_4);
15422  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
15423  }
15424  for (;;) {
15425  if (likely(!__pyx_t_6)) {
15426  if (likely(PyList_CheckExact(__pyx_t_4))) {
15427  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
15428  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15429  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15430  #else
15431  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15432  __Pyx_GOTREF(__pyx_t_7);
15433  #endif
15434  } else {
15435  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
15436  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15437  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15438  #else
15439  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15440  __Pyx_GOTREF(__pyx_t_7);
15441  #endif
15442  }
15443  } else {
15444  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15445  if (unlikely(!__pyx_t_7)) {
15446  PyObject* exc_type = PyErr_Occurred();
15447  if (exc_type) {
15448  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15449  else __PYX_ERR(1, 679, __pyx_L1_error)
15450  }
15451  break;
15452  }
15453  __Pyx_GOTREF(__pyx_t_7);
15454  }
15455  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15456  __pyx_t_7 = 0;
15457  __Pyx_INCREF(__pyx_t_3);
15458  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15459  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15460  __Pyx_GOTREF(__pyx_t_7);
15461  __Pyx_DECREF(__pyx_t_3);
15462  __pyx_t_3 = __pyx_t_7;
15463  __pyx_t_7 = 0;
15464 
15465  /* "View.MemoryView":680
15466  * seen_ellipsis = False
15467  * for idx, item in enumerate(tup):
15468  * if item is Ellipsis: # <<<<<<<<<<<<<<
15469  * if not seen_ellipsis:
15470  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15471  */
15472  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15473  __pyx_t_1 = (__pyx_t_2 != 0);
15474  if (__pyx_t_1) {
15475 
15476  /* "View.MemoryView":681
15477  * for idx, item in enumerate(tup):
15478  * if item is Ellipsis:
15479  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15480  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15481  * seen_ellipsis = True
15482  */
15483  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15484  if (__pyx_t_1) {
15485 
15486  /* "View.MemoryView":682
15487  * if item is Ellipsis:
15488  * if not seen_ellipsis:
15489  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
15490  * seen_ellipsis = True
15491  * else:
15492  */
15493  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15494  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
15495  __Pyx_GOTREF(__pyx_t_7);
15496  { Py_ssize_t __pyx_temp;
15497  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15498  __Pyx_INCREF(__pyx_slice__24);
15499  __Pyx_GIVEREF(__pyx_slice__24);
15500  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__24);
15501  }
15502  }
15503  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15504  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15505 
15506  /* "View.MemoryView":683
15507  * if not seen_ellipsis:
15508  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15509  * seen_ellipsis = True # <<<<<<<<<<<<<<
15510  * else:
15511  * result.append(slice(None))
15512  */
15513  __pyx_v_seen_ellipsis = 1;
15514 
15515  /* "View.MemoryView":681
15516  * for idx, item in enumerate(tup):
15517  * if item is Ellipsis:
15518  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15519  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15520  * seen_ellipsis = True
15521  */
15522  goto __pyx_L7;
15523  }
15524 
15525  /* "View.MemoryView":685
15526  * seen_ellipsis = True
15527  * else:
15528  * result.append(slice(None)) # <<<<<<<<<<<<<<
15529  * have_slices = True
15530  * else:
15531  */
15532  /*else*/ {
15533  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__24); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
15534  }
15535  __pyx_L7:;
15536 
15537  /* "View.MemoryView":686
15538  * else:
15539  * result.append(slice(None))
15540  * have_slices = True # <<<<<<<<<<<<<<
15541  * else:
15542  * if not isinstance(item, slice) and not PyIndex_Check(item):
15543  */
15544  __pyx_v_have_slices = 1;
15545 
15546  /* "View.MemoryView":680
15547  * seen_ellipsis = False
15548  * for idx, item in enumerate(tup):
15549  * if item is Ellipsis: # <<<<<<<<<<<<<<
15550  * if not seen_ellipsis:
15551  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15552  */
15553  goto __pyx_L6;
15554  }
15555 
15556  /* "View.MemoryView":688
15557  * have_slices = True
15558  * else:
15559  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15560  * raise TypeError("Cannot index with type '%s'" % type(item))
15561  *
15562  */
15563  /*else*/ {
15564  __pyx_t_2 = PySlice_Check(__pyx_v_item);
15565  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15566  if (__pyx_t_10) {
15567  } else {
15568  __pyx_t_1 = __pyx_t_10;
15569  goto __pyx_L9_bool_binop_done;
15570  }
15571  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15572  __pyx_t_1 = __pyx_t_10;
15573  __pyx_L9_bool_binop_done:;
15574  if (unlikely(__pyx_t_1)) {
15575 
15576  /* "View.MemoryView":689
15577  * else:
15578  * if not isinstance(item, slice) and not PyIndex_Check(item):
15579  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
15580  *
15581  * have_slices = have_slices or isinstance(item, slice)
15582  */
15583  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
15584  __Pyx_GOTREF(__pyx_t_7);
15585  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
15586  __Pyx_GOTREF(__pyx_t_11);
15587  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15588  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15589  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15590  __PYX_ERR(1, 689, __pyx_L1_error)
15591 
15592  /* "View.MemoryView":688
15593  * have_slices = True
15594  * else:
15595  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15596  * raise TypeError("Cannot index with type '%s'" % type(item))
15597  *
15598  */
15599  }
15600 
15601  /* "View.MemoryView":691
15602  * raise TypeError("Cannot index with type '%s'" % type(item))
15603  *
15604  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15605  * result.append(item)
15606  *
15607  */
15608  __pyx_t_10 = (__pyx_v_have_slices != 0);
15609  if (!__pyx_t_10) {
15610  } else {
15611  __pyx_t_1 = __pyx_t_10;
15612  goto __pyx_L11_bool_binop_done;
15613  }
15614  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15615  __pyx_t_2 = (__pyx_t_10 != 0);
15616  __pyx_t_1 = __pyx_t_2;
15617  __pyx_L11_bool_binop_done:;
15618  __pyx_v_have_slices = __pyx_t_1;
15619 
15620  /* "View.MemoryView":692
15621  *
15622  * have_slices = have_slices or isinstance(item, slice)
15623  * result.append(item) # <<<<<<<<<<<<<<
15624  *
15625  * nslices = ndim - len(result)
15626  */
15627  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
15628  }
15629  __pyx_L6:;
15630 
15631  /* "View.MemoryView":679
15632  * have_slices = False
15633  * seen_ellipsis = False
15634  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15635  * if item is Ellipsis:
15636  * if not seen_ellipsis:
15637  */
15638  }
15639  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15640  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15641 
15642  /* "View.MemoryView":694
15643  * result.append(item)
15644  *
15645  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15646  * if nslices:
15647  * result.extend([slice(None)] * nslices)
15648  */
15649  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
15650  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15651 
15652  /* "View.MemoryView":695
15653  *
15654  * nslices = ndim - len(result)
15655  * if nslices: # <<<<<<<<<<<<<<
15656  * result.extend([slice(None)] * nslices)
15657  *
15658  */
15659  __pyx_t_1 = (__pyx_v_nslices != 0);
15660  if (__pyx_t_1) {
15661 
15662  /* "View.MemoryView":696
15663  * nslices = ndim - len(result)
15664  * if nslices:
15665  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15666  *
15667  * return have_slices or nslices, tuple(result)
15668  */
15669  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
15670  __Pyx_GOTREF(__pyx_t_3);
15671  { Py_ssize_t __pyx_temp;
15672  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15673  __Pyx_INCREF(__pyx_slice__24);
15674  __Pyx_GIVEREF(__pyx_slice__24);
15675  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__24);
15676  }
15677  }
15678  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
15679  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15680 
15681  /* "View.MemoryView":695
15682  *
15683  * nslices = ndim - len(result)
15684  * if nslices: # <<<<<<<<<<<<<<
15685  * result.extend([slice(None)] * nslices)
15686  *
15687  */
15688  }
15689 
15690  /* "View.MemoryView":698
15691  * result.extend([slice(None)] * nslices)
15692  *
15693  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15694  *
15695  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15696  */
15697  __Pyx_XDECREF(__pyx_r);
15698  if (!__pyx_v_have_slices) {
15699  } else {
15700  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15701  __Pyx_GOTREF(__pyx_t_4);
15702  __pyx_t_3 = __pyx_t_4;
15703  __pyx_t_4 = 0;
15704  goto __pyx_L14_bool_binop_done;
15705  }
15706  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15707  __Pyx_GOTREF(__pyx_t_4);
15708  __pyx_t_3 = __pyx_t_4;
15709  __pyx_t_4 = 0;
15710  __pyx_L14_bool_binop_done:;
15711  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15712  __Pyx_GOTREF(__pyx_t_4);
15713  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
15714  __Pyx_GOTREF(__pyx_t_11);
15715  __Pyx_GIVEREF(__pyx_t_3);
15716  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15717  __Pyx_GIVEREF(__pyx_t_4);
15718  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15719  __pyx_t_3 = 0;
15720  __pyx_t_4 = 0;
15721  __pyx_r = ((PyObject*)__pyx_t_11);
15722  __pyx_t_11 = 0;
15723  goto __pyx_L0;
15724 
15725  /* "View.MemoryView":666
15726  * return isinstance(o, memoryview)
15727  *
15728  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15729  * """
15730  * Replace all ellipses with full slices and fill incomplete indices with
15731  */
15732 
15733  /* function exit code */
15734  __pyx_L1_error:;
15735  __Pyx_XDECREF(__pyx_t_3);
15736  __Pyx_XDECREF(__pyx_t_4);
15737  __Pyx_XDECREF(__pyx_t_7);
15738  __Pyx_XDECREF(__pyx_t_11);
15739  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15740  __pyx_r = 0;
15741  __pyx_L0:;
15742  __Pyx_XDECREF(__pyx_v_tup);
15743  __Pyx_XDECREF(__pyx_v_result);
15744  __Pyx_XDECREF(__pyx_v_idx);
15745  __Pyx_XDECREF(__pyx_v_item);
15746  __Pyx_XGIVEREF(__pyx_r);
15747  __Pyx_RefNannyFinishContext();
15748  return __pyx_r;
15749 }
15750 
15751 /* "View.MemoryView":700
15752  * return have_slices or nslices, tuple(result)
15753  *
15754  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15755  * for suboffset in suboffsets[:ndim]:
15756  * if suboffset >= 0:
15757  */
15758 
15759 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15760  Py_ssize_t __pyx_v_suboffset;
15761  PyObject *__pyx_r = NULL;
15762  __Pyx_RefNannyDeclarations
15763  Py_ssize_t *__pyx_t_1;
15764  Py_ssize_t *__pyx_t_2;
15765  Py_ssize_t *__pyx_t_3;
15766  int __pyx_t_4;
15767  PyObject *__pyx_t_5 = NULL;
15768  int __pyx_lineno = 0;
15769  const char *__pyx_filename = NULL;
15770  int __pyx_clineno = 0;
15771  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15772 
15773  /* "View.MemoryView":701
15774  *
15775  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15776  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15777  * if suboffset >= 0:
15778  * raise ValueError("Indirect dimensions not supported")
15779  */
15780  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15781  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15782  __pyx_t_1 = __pyx_t_3;
15783  __pyx_v_suboffset = (__pyx_t_1[0]);
15784 
15785  /* "View.MemoryView":702
15786  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15787  * for suboffset in suboffsets[:ndim]:
15788  * if suboffset >= 0: # <<<<<<<<<<<<<<
15789  * raise ValueError("Indirect dimensions not supported")
15790  *
15791  */
15792  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15793  if (unlikely(__pyx_t_4)) {
15794 
15795  /* "View.MemoryView":703
15796  * for suboffset in suboffsets[:ndim]:
15797  * if suboffset >= 0:
15798  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15799  *
15800  *
15801  */
15802  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
15803  __Pyx_GOTREF(__pyx_t_5);
15804  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15805  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15806  __PYX_ERR(1, 703, __pyx_L1_error)
15807 
15808  /* "View.MemoryView":702
15809  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15810  * for suboffset in suboffsets[:ndim]:
15811  * if suboffset >= 0: # <<<<<<<<<<<<<<
15812  * raise ValueError("Indirect dimensions not supported")
15813  *
15814  */
15815  }
15816  }
15817 
15818  /* "View.MemoryView":700
15819  * return have_slices or nslices, tuple(result)
15820  *
15821  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15822  * for suboffset in suboffsets[:ndim]:
15823  * if suboffset >= 0:
15824  */
15825 
15826  /* function exit code */
15827  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15828  goto __pyx_L0;
15829  __pyx_L1_error:;
15830  __Pyx_XDECREF(__pyx_t_5);
15831  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15832  __pyx_r = 0;
15833  __pyx_L0:;
15834  __Pyx_XGIVEREF(__pyx_r);
15835  __Pyx_RefNannyFinishContext();
15836  return __pyx_r;
15837 }
15838 
15839 /* "View.MemoryView":710
15840  *
15841  * @cname('__pyx_memview_slice')
15842  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15843  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15844  * cdef bint negative_step
15845  */
15846 
15847 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15848  int __pyx_v_new_ndim;
15849  int __pyx_v_suboffset_dim;
15850  int __pyx_v_dim;
15851  __Pyx_memviewslice __pyx_v_src;
15852  __Pyx_memviewslice __pyx_v_dst;
15853  __Pyx_memviewslice *__pyx_v_p_src;
15854  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15855  __Pyx_memviewslice *__pyx_v_p_dst;
15856  int *__pyx_v_p_suboffset_dim;
15857  Py_ssize_t __pyx_v_start;
15858  Py_ssize_t __pyx_v_stop;
15859  Py_ssize_t __pyx_v_step;
15860  int __pyx_v_have_start;
15861  int __pyx_v_have_stop;
15862  int __pyx_v_have_step;
15863  PyObject *__pyx_v_index = NULL;
15864  struct __pyx_memoryview_obj *__pyx_r = NULL;
15865  __Pyx_RefNannyDeclarations
15866  int __pyx_t_1;
15867  int __pyx_t_2;
15868  PyObject *__pyx_t_3 = NULL;
15869  struct __pyx_memoryview_obj *__pyx_t_4;
15870  char *__pyx_t_5;
15871  int __pyx_t_6;
15872  Py_ssize_t __pyx_t_7;
15873  PyObject *(*__pyx_t_8)(PyObject *);
15874  PyObject *__pyx_t_9 = NULL;
15875  Py_ssize_t __pyx_t_10;
15876  int __pyx_t_11;
15877  Py_ssize_t __pyx_t_12;
15878  int __pyx_lineno = 0;
15879  const char *__pyx_filename = NULL;
15880  int __pyx_clineno = 0;
15881  __Pyx_RefNannySetupContext("memview_slice", 0);
15882 
15883  /* "View.MemoryView":711
15884  * @cname('__pyx_memview_slice')
15885  * cdef memoryview memview_slice(memoryview memview, object indices):
15886  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
15887  * cdef bint negative_step
15888  * cdef __Pyx_memviewslice src, dst
15889  */
15890  __pyx_v_new_ndim = 0;
15891  __pyx_v_suboffset_dim = -1;
15892 
15893  /* "View.MemoryView":718
15894  *
15895  *
15896  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
15897  *
15898  * cdef _memoryviewslice memviewsliceobj
15899  */
15900  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
15901 
15902  /* "View.MemoryView":722
15903  * cdef _memoryviewslice memviewsliceobj
15904  *
15905  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
15906  *
15907  * if isinstance(memview, _memoryviewslice):
15908  */
15909  #ifndef CYTHON_WITHOUT_ASSERTIONS
15910  if (unlikely(!Py_OptimizeFlag)) {
15911  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15912  PyErr_SetNone(PyExc_AssertionError);
15913  __PYX_ERR(1, 722, __pyx_L1_error)
15914  }
15915  }
15916  #endif
15917 
15918  /* "View.MemoryView":724
15919  * assert memview.view.ndim > 0
15920  *
15921  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15922  * memviewsliceobj = memview
15923  * p_src = &memviewsliceobj.from_slice
15924  */
15925  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15926  __pyx_t_2 = (__pyx_t_1 != 0);
15927  if (__pyx_t_2) {
15928 
15929  /* "View.MemoryView":725
15930  *
15931  * if isinstance(memview, _memoryviewslice):
15932  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15933  * p_src = &memviewsliceobj.from_slice
15934  * else:
15935  */
15936  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
15937  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15938  __Pyx_INCREF(__pyx_t_3);
15939  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15940  __pyx_t_3 = 0;
15941 
15942  /* "View.MemoryView":726
15943  * if isinstance(memview, _memoryviewslice):
15944  * memviewsliceobj = memview
15945  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15946  * else:
15947  * slice_copy(memview, &src)
15948  */
15949  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15950 
15951  /* "View.MemoryView":724
15952  * assert memview.view.ndim > 0
15953  *
15954  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15955  * memviewsliceobj = memview
15956  * p_src = &memviewsliceobj.from_slice
15957  */
15958  goto __pyx_L3;
15959  }
15960 
15961  /* "View.MemoryView":728
15962  * p_src = &memviewsliceobj.from_slice
15963  * else:
15964  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15965  * p_src = &src
15966  *
15967  */
15968  /*else*/ {
15969  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15970 
15971  /* "View.MemoryView":729
15972  * else:
15973  * slice_copy(memview, &src)
15974  * p_src = &src # <<<<<<<<<<<<<<
15975  *
15976  *
15977  */
15978  __pyx_v_p_src = (&__pyx_v_src);
15979  }
15980  __pyx_L3:;
15981 
15982  /* "View.MemoryView":735
15983  *
15984  *
15985  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15986  * dst.data = p_src.data
15987  *
15988  */
15989  __pyx_t_4 = __pyx_v_p_src->memview;
15990  __pyx_v_dst.memview = __pyx_t_4;
15991 
15992  /* "View.MemoryView":736
15993  *
15994  * dst.memview = p_src.memview
15995  * dst.data = p_src.data # <<<<<<<<<<<<<<
15996  *
15997  *
15998  */
15999  __pyx_t_5 = __pyx_v_p_src->data;
16000  __pyx_v_dst.data = __pyx_t_5;
16001 
16002  /* "View.MemoryView":741
16003  *
16004  *
16005  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
16006  * cdef int *p_suboffset_dim = &suboffset_dim
16007  * cdef Py_ssize_t start, stop, step
16008  */
16009  __pyx_v_p_dst = (&__pyx_v_dst);
16010 
16011  /* "View.MemoryView":742
16012  *
16013  * cdef __Pyx_memviewslice *p_dst = &dst
16014  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
16015  * cdef Py_ssize_t start, stop, step
16016  * cdef bint have_start, have_stop, have_step
16017  */
16018  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
16019 
16020  /* "View.MemoryView":746
16021  * cdef bint have_start, have_stop, have_step
16022  *
16023  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16024  * if PyIndex_Check(index):
16025  * slice_memviewslice(
16026  */
16027  __pyx_t_6 = 0;
16028  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
16029  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
16030  __pyx_t_8 = NULL;
16031  } else {
16032  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
16033  __Pyx_GOTREF(__pyx_t_3);
16034  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
16035  }
16036  for (;;) {
16037  if (likely(!__pyx_t_8)) {
16038  if (likely(PyList_CheckExact(__pyx_t_3))) {
16039  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
16040  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16041  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
16042  #else
16043  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
16044  __Pyx_GOTREF(__pyx_t_9);
16045  #endif
16046  } else {
16047  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
16048  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16049  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
16050  #else
16051  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
16052  __Pyx_GOTREF(__pyx_t_9);
16053  #endif
16054  }
16055  } else {
16056  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
16057  if (unlikely(!__pyx_t_9)) {
16058  PyObject* exc_type = PyErr_Occurred();
16059  if (exc_type) {
16060  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16061  else __PYX_ERR(1, 746, __pyx_L1_error)
16062  }
16063  break;
16064  }
16065  __Pyx_GOTREF(__pyx_t_9);
16066  }
16067  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
16068  __pyx_t_9 = 0;
16069  __pyx_v_dim = __pyx_t_6;
16070  __pyx_t_6 = (__pyx_t_6 + 1);
16071 
16072  /* "View.MemoryView":747
16073  *
16074  * for dim, index in enumerate(indices):
16075  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
16076  * slice_memviewslice(
16077  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16078  */
16079  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
16080  if (__pyx_t_2) {
16081 
16082  /* "View.MemoryView":751
16083  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16084  * dim, new_ndim, p_suboffset_dim,
16085  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
16086  * 0, 0, 0, # have_{start,stop,step}
16087  * False)
16088  */
16089  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
16090 
16091  /* "View.MemoryView":748
16092  * for dim, index in enumerate(indices):
16093  * if PyIndex_Check(index):
16094  * slice_memviewslice( # <<<<<<<<<<<<<<
16095  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16096  * dim, new_ndim, p_suboffset_dim,
16097  */
16098  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
16099 
16100  /* "View.MemoryView":747
16101  *
16102  * for dim, index in enumerate(indices):
16103  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
16104  * slice_memviewslice(
16105  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16106  */
16107  goto __pyx_L6;
16108  }
16109 
16110  /* "View.MemoryView":754
16111  * 0, 0, 0, # have_{start,stop,step}
16112  * False)
16113  * elif index is None: # <<<<<<<<<<<<<<
16114  * p_dst.shape[new_ndim] = 1
16115  * p_dst.strides[new_ndim] = 0
16116  */
16117  __pyx_t_2 = (__pyx_v_index == Py_None);
16118  __pyx_t_1 = (__pyx_t_2 != 0);
16119  if (__pyx_t_1) {
16120 
16121  /* "View.MemoryView":755
16122  * False)
16123  * elif index is None:
16124  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
16125  * p_dst.strides[new_ndim] = 0
16126  * p_dst.suboffsets[new_ndim] = -1
16127  */
16128  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
16129 
16130  /* "View.MemoryView":756
16131  * elif index is None:
16132  * p_dst.shape[new_ndim] = 1
16133  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
16134  * p_dst.suboffsets[new_ndim] = -1
16135  * new_ndim += 1
16136  */
16137  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
16138 
16139  /* "View.MemoryView":757
16140  * p_dst.shape[new_ndim] = 1
16141  * p_dst.strides[new_ndim] = 0
16142  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
16143  * new_ndim += 1
16144  * else:
16145  */
16146  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
16147 
16148  /* "View.MemoryView":758
16149  * p_dst.strides[new_ndim] = 0
16150  * p_dst.suboffsets[new_ndim] = -1
16151  * new_ndim += 1 # <<<<<<<<<<<<<<
16152  * else:
16153  * start = index.start or 0
16154  */
16155  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16156 
16157  /* "View.MemoryView":754
16158  * 0, 0, 0, # have_{start,stop,step}
16159  * False)
16160  * elif index is None: # <<<<<<<<<<<<<<
16161  * p_dst.shape[new_ndim] = 1
16162  * p_dst.strides[new_ndim] = 0
16163  */
16164  goto __pyx_L6;
16165  }
16166 
16167  /* "View.MemoryView":760
16168  * new_ndim += 1
16169  * else:
16170  * start = index.start or 0 # <<<<<<<<<<<<<<
16171  * stop = index.stop or 0
16172  * step = index.step or 0
16173  */
16174  /*else*/ {
16175  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
16176  __Pyx_GOTREF(__pyx_t_9);
16177  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
16178  if (!__pyx_t_1) {
16179  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16180  } else {
16181  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
16182  __pyx_t_10 = __pyx_t_12;
16183  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16184  goto __pyx_L7_bool_binop_done;
16185  }
16186  __pyx_t_10 = 0;
16187  __pyx_L7_bool_binop_done:;
16188  __pyx_v_start = __pyx_t_10;
16189 
16190  /* "View.MemoryView":761
16191  * else:
16192  * start = index.start or 0
16193  * stop = index.stop or 0 # <<<<<<<<<<<<<<
16194  * step = index.step or 0
16195  *
16196  */
16197  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
16198  __Pyx_GOTREF(__pyx_t_9);
16199  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
16200  if (!__pyx_t_1) {
16201  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16202  } else {
16203  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
16204  __pyx_t_10 = __pyx_t_12;
16205  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16206  goto __pyx_L9_bool_binop_done;
16207  }
16208  __pyx_t_10 = 0;
16209  __pyx_L9_bool_binop_done:;
16210  __pyx_v_stop = __pyx_t_10;
16211 
16212  /* "View.MemoryView":762
16213  * start = index.start or 0
16214  * stop = index.stop or 0
16215  * step = index.step or 0 # <<<<<<<<<<<<<<
16216  *
16217  * have_start = index.start is not None
16218  */
16219  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
16220  __Pyx_GOTREF(__pyx_t_9);
16221  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
16222  if (!__pyx_t_1) {
16223  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16224  } else {
16225  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
16226  __pyx_t_10 = __pyx_t_12;
16227  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16228  goto __pyx_L11_bool_binop_done;
16229  }
16230  __pyx_t_10 = 0;
16231  __pyx_L11_bool_binop_done:;
16232  __pyx_v_step = __pyx_t_10;
16233 
16234  /* "View.MemoryView":764
16235  * step = index.step or 0
16236  *
16237  * have_start = index.start is not None # <<<<<<<<<<<<<<
16238  * have_stop = index.stop is not None
16239  * have_step = index.step is not None
16240  */
16241  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
16242  __Pyx_GOTREF(__pyx_t_9);
16243  __pyx_t_1 = (__pyx_t_9 != Py_None);
16244  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16245  __pyx_v_have_start = __pyx_t_1;
16246 
16247  /* "View.MemoryView":765
16248  *
16249  * have_start = index.start is not None
16250  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
16251  * have_step = index.step is not None
16252  *
16253  */
16254  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
16255  __Pyx_GOTREF(__pyx_t_9);
16256  __pyx_t_1 = (__pyx_t_9 != Py_None);
16257  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16258  __pyx_v_have_stop = __pyx_t_1;
16259 
16260  /* "View.MemoryView":766
16261  * have_start = index.start is not None
16262  * have_stop = index.stop is not None
16263  * have_step = index.step is not None # <<<<<<<<<<<<<<
16264  *
16265  * slice_memviewslice(
16266  */
16267  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
16268  __Pyx_GOTREF(__pyx_t_9);
16269  __pyx_t_1 = (__pyx_t_9 != Py_None);
16270  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16271  __pyx_v_have_step = __pyx_t_1;
16272 
16273  /* "View.MemoryView":768
16274  * have_step = index.step is not None
16275  *
16276  * slice_memviewslice( # <<<<<<<<<<<<<<
16277  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16278  * dim, new_ndim, p_suboffset_dim,
16279  */
16280  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
16281 
16282  /* "View.MemoryView":774
16283  * have_start, have_stop, have_step,
16284  * True)
16285  * new_ndim += 1 # <<<<<<<<<<<<<<
16286  *
16287  * if isinstance(memview, _memoryviewslice):
16288  */
16289  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16290  }
16291  __pyx_L6:;
16292 
16293  /* "View.MemoryView":746
16294  * cdef bint have_start, have_stop, have_step
16295  *
16296  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16297  * if PyIndex_Check(index):
16298  * slice_memviewslice(
16299  */
16300  }
16301  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16302 
16303  /* "View.MemoryView":776
16304  * new_ndim += 1
16305  *
16306  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16307  * return memoryview_fromslice(dst, new_ndim,
16308  * memviewsliceobj.to_object_func,
16309  */
16310  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16311  __pyx_t_2 = (__pyx_t_1 != 0);
16312  if (__pyx_t_2) {
16313 
16314  /* "View.MemoryView":777
16315  *
16316  * if isinstance(memview, _memoryviewslice):
16317  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16318  * memviewsliceobj.to_object_func,
16319  * memviewsliceobj.to_dtype_func,
16320  */
16321  __Pyx_XDECREF(((PyObject *)__pyx_r));
16322 
16323  /* "View.MemoryView":778
16324  * if isinstance(memview, _memoryviewslice):
16325  * return memoryview_fromslice(dst, new_ndim,
16326  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
16327  * memviewsliceobj.to_dtype_func,
16328  * memview.dtype_is_object)
16329  */
16330  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
16331 
16332  /* "View.MemoryView":779
16333  * return memoryview_fromslice(dst, new_ndim,
16334  * memviewsliceobj.to_object_func,
16335  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
16336  * memview.dtype_is_object)
16337  * else:
16338  */
16339  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
16340 
16341  /* "View.MemoryView":777
16342  *
16343  * if isinstance(memview, _memoryviewslice):
16344  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16345  * memviewsliceobj.to_object_func,
16346  * memviewsliceobj.to_dtype_func,
16347  */
16348  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
16349  __Pyx_GOTREF(__pyx_t_3);
16350  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
16351  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16352  __pyx_t_3 = 0;
16353  goto __pyx_L0;
16354 
16355  /* "View.MemoryView":776
16356  * new_ndim += 1
16357  *
16358  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16359  * return memoryview_fromslice(dst, new_ndim,
16360  * memviewsliceobj.to_object_func,
16361  */
16362  }
16363 
16364  /* "View.MemoryView":782
16365  * memview.dtype_is_object)
16366  * else:
16367  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16368  * memview.dtype_is_object)
16369  *
16370  */
16371  /*else*/ {
16372  __Pyx_XDECREF(((PyObject *)__pyx_r));
16373 
16374  /* "View.MemoryView":783
16375  * else:
16376  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
16377  * memview.dtype_is_object) # <<<<<<<<<<<<<<
16378  *
16379  *
16380  */
16381  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
16382  __Pyx_GOTREF(__pyx_t_3);
16383 
16384  /* "View.MemoryView":782
16385  * memview.dtype_is_object)
16386  * else:
16387  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16388  * memview.dtype_is_object)
16389  *
16390  */
16391  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
16392  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16393  __pyx_t_3 = 0;
16394  goto __pyx_L0;
16395  }
16396 
16397  /* "View.MemoryView":710
16398  *
16399  * @cname('__pyx_memview_slice')
16400  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16401  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16402  * cdef bint negative_step
16403  */
16404 
16405  /* function exit code */
16406  __pyx_L1_error:;
16407  __Pyx_XDECREF(__pyx_t_3);
16408  __Pyx_XDECREF(__pyx_t_9);
16409  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16410  __pyx_r = 0;
16411  __pyx_L0:;
16412  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16413  __Pyx_XDECREF(__pyx_v_index);
16414  __Pyx_XGIVEREF((PyObject *)__pyx_r);
16415  __Pyx_RefNannyFinishContext();
16416  return __pyx_r;
16417 }
16418 
16419 /* "View.MemoryView":807
16420  *
16421  * @cname('__pyx_memoryview_slice_memviewslice')
16422  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16423  * __Pyx_memviewslice *dst,
16424  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16425  */
16426 
16427 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
16428  Py_ssize_t __pyx_v_new_shape;
16429  int __pyx_v_negative_step;
16430  int __pyx_r;
16431  int __pyx_t_1;
16432  int __pyx_t_2;
16433  int __pyx_t_3;
16434  int __pyx_lineno = 0;
16435  const char *__pyx_filename = NULL;
16436  int __pyx_clineno = 0;
16437 
16438  /* "View.MemoryView":827
16439  * cdef bint negative_step
16440  *
16441  * if not is_slice: # <<<<<<<<<<<<<<
16442  *
16443  * if start < 0:
16444  */
16445  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16446  if (__pyx_t_1) {
16447 
16448  /* "View.MemoryView":829
16449  * if not is_slice:
16450  *
16451  * if start < 0: # <<<<<<<<<<<<<<
16452  * start += shape
16453  * if not 0 <= start < shape:
16454  */
16455  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16456  if (__pyx_t_1) {
16457 
16458  /* "View.MemoryView":830
16459  *
16460  * if start < 0:
16461  * start += shape # <<<<<<<<<<<<<<
16462  * if not 0 <= start < shape:
16463  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16464  */
16465  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16466 
16467  /* "View.MemoryView":829
16468  * if not is_slice:
16469  *
16470  * if start < 0: # <<<<<<<<<<<<<<
16471  * start += shape
16472  * if not 0 <= start < shape:
16473  */
16474  }
16475 
16476  /* "View.MemoryView":831
16477  * if start < 0:
16478  * start += shape
16479  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16480  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16481  * else:
16482  */
16483  __pyx_t_1 = (0 <= __pyx_v_start);
16484  if (__pyx_t_1) {
16485  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16486  }
16487  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16488  if (__pyx_t_2) {
16489 
16490  /* "View.MemoryView":832
16491  * start += shape
16492  * if not 0 <= start < shape:
16493  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
16494  * else:
16495  *
16496  */
16497  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
16498 
16499  /* "View.MemoryView":831
16500  * if start < 0:
16501  * start += shape
16502  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16503  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16504  * else:
16505  */
16506  }
16507 
16508  /* "View.MemoryView":827
16509  * cdef bint negative_step
16510  *
16511  * if not is_slice: # <<<<<<<<<<<<<<
16512  *
16513  * if start < 0:
16514  */
16515  goto __pyx_L3;
16516  }
16517 
16518  /* "View.MemoryView":835
16519  * else:
16520  *
16521  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
16522  *
16523  * if have_step and step == 0:
16524  */
16525  /*else*/ {
16526  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16527  if (__pyx_t_1) {
16528  } else {
16529  __pyx_t_2 = __pyx_t_1;
16530  goto __pyx_L6_bool_binop_done;
16531  }
16532  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16533  __pyx_t_2 = __pyx_t_1;
16534  __pyx_L6_bool_binop_done:;
16535  __pyx_v_negative_step = __pyx_t_2;
16536 
16537  /* "View.MemoryView":837
16538  * negative_step = have_step != 0 and step < 0
16539  *
16540  * if have_step and step == 0: # <<<<<<<<<<<<<<
16541  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16542  *
16543  */
16544  __pyx_t_1 = (__pyx_v_have_step != 0);
16545  if (__pyx_t_1) {
16546  } else {
16547  __pyx_t_2 = __pyx_t_1;
16548  goto __pyx_L9_bool_binop_done;
16549  }
16550  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16551  __pyx_t_2 = __pyx_t_1;
16552  __pyx_L9_bool_binop_done:;
16553  if (__pyx_t_2) {
16554 
16555  /* "View.MemoryView":838
16556  *
16557  * if have_step and step == 0:
16558  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
16559  *
16560  *
16561  */
16562  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
16563 
16564  /* "View.MemoryView":837
16565  * negative_step = have_step != 0 and step < 0
16566  *
16567  * if have_step and step == 0: # <<<<<<<<<<<<<<
16568  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16569  *
16570  */
16571  }
16572 
16573  /* "View.MemoryView":841
16574  *
16575  *
16576  * if have_start: # <<<<<<<<<<<<<<
16577  * if start < 0:
16578  * start += shape
16579  */
16580  __pyx_t_2 = (__pyx_v_have_start != 0);
16581  if (__pyx_t_2) {
16582 
16583  /* "View.MemoryView":842
16584  *
16585  * if have_start:
16586  * if start < 0: # <<<<<<<<<<<<<<
16587  * start += shape
16588  * if start < 0:
16589  */
16590  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16591  if (__pyx_t_2) {
16592 
16593  /* "View.MemoryView":843
16594  * if have_start:
16595  * if start < 0:
16596  * start += shape # <<<<<<<<<<<<<<
16597  * if start < 0:
16598  * start = 0
16599  */
16600  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16601 
16602  /* "View.MemoryView":844
16603  * if start < 0:
16604  * start += shape
16605  * if start < 0: # <<<<<<<<<<<<<<
16606  * start = 0
16607  * elif start >= shape:
16608  */
16609  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16610  if (__pyx_t_2) {
16611 
16612  /* "View.MemoryView":845
16613  * start += shape
16614  * if start < 0:
16615  * start = 0 # <<<<<<<<<<<<<<
16616  * elif start >= shape:
16617  * if negative_step:
16618  */
16619  __pyx_v_start = 0;
16620 
16621  /* "View.MemoryView":844
16622  * if start < 0:
16623  * start += shape
16624  * if start < 0: # <<<<<<<<<<<<<<
16625  * start = 0
16626  * elif start >= shape:
16627  */
16628  }
16629 
16630  /* "View.MemoryView":842
16631  *
16632  * if have_start:
16633  * if start < 0: # <<<<<<<<<<<<<<
16634  * start += shape
16635  * if start < 0:
16636  */
16637  goto __pyx_L12;
16638  }
16639 
16640  /* "View.MemoryView":846
16641  * if start < 0:
16642  * start = 0
16643  * elif start >= shape: # <<<<<<<<<<<<<<
16644  * if negative_step:
16645  * start = shape - 1
16646  */
16647  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16648  if (__pyx_t_2) {
16649 
16650  /* "View.MemoryView":847
16651  * start = 0
16652  * elif start >= shape:
16653  * if negative_step: # <<<<<<<<<<<<<<
16654  * start = shape - 1
16655  * else:
16656  */
16657  __pyx_t_2 = (__pyx_v_negative_step != 0);
16658  if (__pyx_t_2) {
16659 
16660  /* "View.MemoryView":848
16661  * elif start >= shape:
16662  * if negative_step:
16663  * start = shape - 1 # <<<<<<<<<<<<<<
16664  * else:
16665  * start = shape
16666  */
16667  __pyx_v_start = (__pyx_v_shape - 1);
16668 
16669  /* "View.MemoryView":847
16670  * start = 0
16671  * elif start >= shape:
16672  * if negative_step: # <<<<<<<<<<<<<<
16673  * start = shape - 1
16674  * else:
16675  */
16676  goto __pyx_L14;
16677  }
16678 
16679  /* "View.MemoryView":850
16680  * start = shape - 1
16681  * else:
16682  * start = shape # <<<<<<<<<<<<<<
16683  * else:
16684  * if negative_step:
16685  */
16686  /*else*/ {
16687  __pyx_v_start = __pyx_v_shape;
16688  }
16689  __pyx_L14:;
16690 
16691  /* "View.MemoryView":846
16692  * if start < 0:
16693  * start = 0
16694  * elif start >= shape: # <<<<<<<<<<<<<<
16695  * if negative_step:
16696  * start = shape - 1
16697  */
16698  }
16699  __pyx_L12:;
16700 
16701  /* "View.MemoryView":841
16702  *
16703  *
16704  * if have_start: # <<<<<<<<<<<<<<
16705  * if start < 0:
16706  * start += shape
16707  */
16708  goto __pyx_L11;
16709  }
16710 
16711  /* "View.MemoryView":852
16712  * start = shape
16713  * else:
16714  * if negative_step: # <<<<<<<<<<<<<<
16715  * start = shape - 1
16716  * else:
16717  */
16718  /*else*/ {
16719  __pyx_t_2 = (__pyx_v_negative_step != 0);
16720  if (__pyx_t_2) {
16721 
16722  /* "View.MemoryView":853
16723  * else:
16724  * if negative_step:
16725  * start = shape - 1 # <<<<<<<<<<<<<<
16726  * else:
16727  * start = 0
16728  */
16729  __pyx_v_start = (__pyx_v_shape - 1);
16730 
16731  /* "View.MemoryView":852
16732  * start = shape
16733  * else:
16734  * if negative_step: # <<<<<<<<<<<<<<
16735  * start = shape - 1
16736  * else:
16737  */
16738  goto __pyx_L15;
16739  }
16740 
16741  /* "View.MemoryView":855
16742  * start = shape - 1
16743  * else:
16744  * start = 0 # <<<<<<<<<<<<<<
16745  *
16746  * if have_stop:
16747  */
16748  /*else*/ {
16749  __pyx_v_start = 0;
16750  }
16751  __pyx_L15:;
16752  }
16753  __pyx_L11:;
16754 
16755  /* "View.MemoryView":857
16756  * start = 0
16757  *
16758  * if have_stop: # <<<<<<<<<<<<<<
16759  * if stop < 0:
16760  * stop += shape
16761  */
16762  __pyx_t_2 = (__pyx_v_have_stop != 0);
16763  if (__pyx_t_2) {
16764 
16765  /* "View.MemoryView":858
16766  *
16767  * if have_stop:
16768  * if stop < 0: # <<<<<<<<<<<<<<
16769  * stop += shape
16770  * if stop < 0:
16771  */
16772  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16773  if (__pyx_t_2) {
16774 
16775  /* "View.MemoryView":859
16776  * if have_stop:
16777  * if stop < 0:
16778  * stop += shape # <<<<<<<<<<<<<<
16779  * if stop < 0:
16780  * stop = 0
16781  */
16782  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16783 
16784  /* "View.MemoryView":860
16785  * if stop < 0:
16786  * stop += shape
16787  * if stop < 0: # <<<<<<<<<<<<<<
16788  * stop = 0
16789  * elif stop > shape:
16790  */
16791  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16792  if (__pyx_t_2) {
16793 
16794  /* "View.MemoryView":861
16795  * stop += shape
16796  * if stop < 0:
16797  * stop = 0 # <<<<<<<<<<<<<<
16798  * elif stop > shape:
16799  * stop = shape
16800  */
16801  __pyx_v_stop = 0;
16802 
16803  /* "View.MemoryView":860
16804  * if stop < 0:
16805  * stop += shape
16806  * if stop < 0: # <<<<<<<<<<<<<<
16807  * stop = 0
16808  * elif stop > shape:
16809  */
16810  }
16811 
16812  /* "View.MemoryView":858
16813  *
16814  * if have_stop:
16815  * if stop < 0: # <<<<<<<<<<<<<<
16816  * stop += shape
16817  * if stop < 0:
16818  */
16819  goto __pyx_L17;
16820  }
16821 
16822  /* "View.MemoryView":862
16823  * if stop < 0:
16824  * stop = 0
16825  * elif stop > shape: # <<<<<<<<<<<<<<
16826  * stop = shape
16827  * else:
16828  */
16829  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16830  if (__pyx_t_2) {
16831 
16832  /* "View.MemoryView":863
16833  * stop = 0
16834  * elif stop > shape:
16835  * stop = shape # <<<<<<<<<<<<<<
16836  * else:
16837  * if negative_step:
16838  */
16839  __pyx_v_stop = __pyx_v_shape;
16840 
16841  /* "View.MemoryView":862
16842  * if stop < 0:
16843  * stop = 0
16844  * elif stop > shape: # <<<<<<<<<<<<<<
16845  * stop = shape
16846  * else:
16847  */
16848  }
16849  __pyx_L17:;
16850 
16851  /* "View.MemoryView":857
16852  * start = 0
16853  *
16854  * if have_stop: # <<<<<<<<<<<<<<
16855  * if stop < 0:
16856  * stop += shape
16857  */
16858  goto __pyx_L16;
16859  }
16860 
16861  /* "View.MemoryView":865
16862  * stop = shape
16863  * else:
16864  * if negative_step: # <<<<<<<<<<<<<<
16865  * stop = -1
16866  * else:
16867  */
16868  /*else*/ {
16869  __pyx_t_2 = (__pyx_v_negative_step != 0);
16870  if (__pyx_t_2) {
16871 
16872  /* "View.MemoryView":866
16873  * else:
16874  * if negative_step:
16875  * stop = -1 # <<<<<<<<<<<<<<
16876  * else:
16877  * stop = shape
16878  */
16879  __pyx_v_stop = -1L;
16880 
16881  /* "View.MemoryView":865
16882  * stop = shape
16883  * else:
16884  * if negative_step: # <<<<<<<<<<<<<<
16885  * stop = -1
16886  * else:
16887  */
16888  goto __pyx_L19;
16889  }
16890 
16891  /* "View.MemoryView":868
16892  * stop = -1
16893  * else:
16894  * stop = shape # <<<<<<<<<<<<<<
16895  *
16896  * if not have_step:
16897  */
16898  /*else*/ {
16899  __pyx_v_stop = __pyx_v_shape;
16900  }
16901  __pyx_L19:;
16902  }
16903  __pyx_L16:;
16904 
16905  /* "View.MemoryView":870
16906  * stop = shape
16907  *
16908  * if not have_step: # <<<<<<<<<<<<<<
16909  * step = 1
16910  *
16911  */
16912  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16913  if (__pyx_t_2) {
16914 
16915  /* "View.MemoryView":871
16916  *
16917  * if not have_step:
16918  * step = 1 # <<<<<<<<<<<<<<
16919  *
16920  *
16921  */
16922  __pyx_v_step = 1;
16923 
16924  /* "View.MemoryView":870
16925  * stop = shape
16926  *
16927  * if not have_step: # <<<<<<<<<<<<<<
16928  * step = 1
16929  *
16930  */
16931  }
16932 
16933  /* "View.MemoryView":875
16934  *
16935  * with cython.cdivision(True):
16936  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16937  *
16938  * if (stop - start) - step * new_shape:
16939  */
16940  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16941 
16942  /* "View.MemoryView":877
16943  * new_shape = (stop - start) // step
16944  *
16945  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16946  * new_shape += 1
16947  *
16948  */
16949  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16950  if (__pyx_t_2) {
16951 
16952  /* "View.MemoryView":878
16953  *
16954  * if (stop - start) - step * new_shape:
16955  * new_shape += 1 # <<<<<<<<<<<<<<
16956  *
16957  * if new_shape < 0:
16958  */
16959  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16960 
16961  /* "View.MemoryView":877
16962  * new_shape = (stop - start) // step
16963  *
16964  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16965  * new_shape += 1
16966  *
16967  */
16968  }
16969 
16970  /* "View.MemoryView":880
16971  * new_shape += 1
16972  *
16973  * if new_shape < 0: # <<<<<<<<<<<<<<
16974  * new_shape = 0
16975  *
16976  */
16977  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16978  if (__pyx_t_2) {
16979 
16980  /* "View.MemoryView":881
16981  *
16982  * if new_shape < 0:
16983  * new_shape = 0 # <<<<<<<<<<<<<<
16984  *
16985  *
16986  */
16987  __pyx_v_new_shape = 0;
16988 
16989  /* "View.MemoryView":880
16990  * new_shape += 1
16991  *
16992  * if new_shape < 0: # <<<<<<<<<<<<<<
16993  * new_shape = 0
16994  *
16995  */
16996  }
16997 
16998  /* "View.MemoryView":884
16999  *
17000  *
17001  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
17002  * dst.shape[new_ndim] = new_shape
17003  * dst.suboffsets[new_ndim] = suboffset
17004  */
17005  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
17006 
17007  /* "View.MemoryView":885
17008  *
17009  * dst.strides[new_ndim] = stride * step
17010  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
17011  * dst.suboffsets[new_ndim] = suboffset
17012  *
17013  */
17014  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
17015 
17016  /* "View.MemoryView":886
17017  * dst.strides[new_ndim] = stride * step
17018  * dst.shape[new_ndim] = new_shape
17019  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
17020  *
17021  *
17022  */
17023  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
17024  }
17025  __pyx_L3:;
17026 
17027  /* "View.MemoryView":889
17028  *
17029  *
17030  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
17031  * dst.data += start * stride
17032  * else:
17033  */
17034  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
17035  if (__pyx_t_2) {
17036 
17037  /* "View.MemoryView":890
17038  *
17039  * if suboffset_dim[0] < 0:
17040  * dst.data += start * stride # <<<<<<<<<<<<<<
17041  * else:
17042  * dst.suboffsets[suboffset_dim[0]] += start * stride
17043  */
17044  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
17045 
17046  /* "View.MemoryView":889
17047  *
17048  *
17049  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
17050  * dst.data += start * stride
17051  * else:
17052  */
17053  goto __pyx_L23;
17054  }
17055 
17056  /* "View.MemoryView":892
17057  * dst.data += start * stride
17058  * else:
17059  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
17060  *
17061  * if suboffset >= 0:
17062  */
17063  /*else*/ {
17064  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
17065  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
17066  }
17067  __pyx_L23:;
17068 
17069  /* "View.MemoryView":894
17070  * dst.suboffsets[suboffset_dim[0]] += start * stride
17071  *
17072  * if suboffset >= 0: # <<<<<<<<<<<<<<
17073  * if not is_slice:
17074  * if new_ndim == 0:
17075  */
17076  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17077  if (__pyx_t_2) {
17078 
17079  /* "View.MemoryView":895
17080  *
17081  * if suboffset >= 0:
17082  * if not is_slice: # <<<<<<<<<<<<<<
17083  * if new_ndim == 0:
17084  * dst.data = (<char **> dst.data)[0] + suboffset
17085  */
17086  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
17087  if (__pyx_t_2) {
17088 
17089  /* "View.MemoryView":896
17090  * if suboffset >= 0:
17091  * if not is_slice:
17092  * if new_ndim == 0: # <<<<<<<<<<<<<<
17093  * dst.data = (<char **> dst.data)[0] + suboffset
17094  * else:
17095  */
17096  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
17097  if (__pyx_t_2) {
17098 
17099  /* "View.MemoryView":897
17100  * if not is_slice:
17101  * if new_ndim == 0:
17102  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
17103  * else:
17104  * _err_dim(IndexError, "All dimensions preceding dimension %d "
17105  */
17106  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
17107 
17108  /* "View.MemoryView":896
17109  * if suboffset >= 0:
17110  * if not is_slice:
17111  * if new_ndim == 0: # <<<<<<<<<<<<<<
17112  * dst.data = (<char **> dst.data)[0] + suboffset
17113  * else:
17114  */
17115  goto __pyx_L26;
17116  }
17117 
17118  /* "View.MemoryView":899
17119  * dst.data = (<char **> dst.data)[0] + suboffset
17120  * else:
17121  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
17122  * "must be indexed and not sliced", dim)
17123  * else:
17124  */
17125  /*else*/ {
17126 
17127  /* "View.MemoryView":900
17128  * else:
17129  * _err_dim(IndexError, "All dimensions preceding dimension %d "
17130  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
17131  * else:
17132  * suboffset_dim[0] = new_ndim
17133  */
17134  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
17135  }
17136  __pyx_L26:;
17137 
17138  /* "View.MemoryView":895
17139  *
17140  * if suboffset >= 0:
17141  * if not is_slice: # <<<<<<<<<<<<<<
17142  * if new_ndim == 0:
17143  * dst.data = (<char **> dst.data)[0] + suboffset
17144  */
17145  goto __pyx_L25;
17146  }
17147 
17148  /* "View.MemoryView":902
17149  * "must be indexed and not sliced", dim)
17150  * else:
17151  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
17152  *
17153  * return 0
17154  */
17155  /*else*/ {
17156  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
17157  }
17158  __pyx_L25:;
17159 
17160  /* "View.MemoryView":894
17161  * dst.suboffsets[suboffset_dim[0]] += start * stride
17162  *
17163  * if suboffset >= 0: # <<<<<<<<<<<<<<
17164  * if not is_slice:
17165  * if new_ndim == 0:
17166  */
17167  }
17168 
17169  /* "View.MemoryView":904
17170  * suboffset_dim[0] = new_ndim
17171  *
17172  * return 0 # <<<<<<<<<<<<<<
17173  *
17174  *
17175  */
17176  __pyx_r = 0;
17177  goto __pyx_L0;
17178 
17179  /* "View.MemoryView":807
17180  *
17181  * @cname('__pyx_memoryview_slice_memviewslice')
17182  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
17183  * __Pyx_memviewslice *dst,
17184  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
17185  */
17186 
17187  /* function exit code */
17188  __pyx_L1_error:;
17189  {
17190  #ifdef WITH_THREAD
17191  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17192  #endif
17193  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17194  #ifdef WITH_THREAD
17195  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17196  #endif
17197  }
17198  __pyx_r = -1;
17199  __pyx_L0:;
17200  return __pyx_r;
17201 }
17202 
17203 /* "View.MemoryView":910
17204  *
17205  * @cname('__pyx_pybuffer_index')
17206  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17207  * Py_ssize_t dim) except NULL:
17208  * cdef Py_ssize_t shape, stride, suboffset = -1
17209  */
17210 
17211 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
17212  Py_ssize_t __pyx_v_shape;
17213  Py_ssize_t __pyx_v_stride;
17214  Py_ssize_t __pyx_v_suboffset;
17215  Py_ssize_t __pyx_v_itemsize;
17216  char *__pyx_v_resultp;
17217  char *__pyx_r;
17218  __Pyx_RefNannyDeclarations
17219  Py_ssize_t __pyx_t_1;
17220  int __pyx_t_2;
17221  PyObject *__pyx_t_3 = NULL;
17222  PyObject *__pyx_t_4 = NULL;
17223  int __pyx_lineno = 0;
17224  const char *__pyx_filename = NULL;
17225  int __pyx_clineno = 0;
17226  __Pyx_RefNannySetupContext("pybuffer_index", 0);
17227 
17228  /* "View.MemoryView":912
17229  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
17230  * Py_ssize_t dim) except NULL:
17231  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
17232  * cdef Py_ssize_t itemsize = view.itemsize
17233  * cdef char *resultp
17234  */
17235  __pyx_v_suboffset = -1L;
17236 
17237  /* "View.MemoryView":913
17238  * Py_ssize_t dim) except NULL:
17239  * cdef Py_ssize_t shape, stride, suboffset = -1
17240  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
17241  * cdef char *resultp
17242  *
17243  */
17244  __pyx_t_1 = __pyx_v_view->itemsize;
17245  __pyx_v_itemsize = __pyx_t_1;
17246 
17247  /* "View.MemoryView":916
17248  * cdef char *resultp
17249  *
17250  * if view.ndim == 0: # <<<<<<<<<<<<<<
17251  * shape = view.len / itemsize
17252  * stride = itemsize
17253  */
17254  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17255  if (__pyx_t_2) {
17256 
17257  /* "View.MemoryView":917
17258  *
17259  * if view.ndim == 0:
17260  * shape = view.len / itemsize # <<<<<<<<<<<<<<
17261  * stride = itemsize
17262  * else:
17263  */
17264  if (unlikely(__pyx_v_itemsize == 0)) {
17265  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
17266  __PYX_ERR(1, 917, __pyx_L1_error)
17267  }
17268  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
17269  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
17270  __PYX_ERR(1, 917, __pyx_L1_error)
17271  }
17272  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17273 
17274  /* "View.MemoryView":918
17275  * if view.ndim == 0:
17276  * shape = view.len / itemsize
17277  * stride = itemsize # <<<<<<<<<<<<<<
17278  * else:
17279  * shape = view.shape[dim]
17280  */
17281  __pyx_v_stride = __pyx_v_itemsize;
17282 
17283  /* "View.MemoryView":916
17284  * cdef char *resultp
17285  *
17286  * if view.ndim == 0: # <<<<<<<<<<<<<<
17287  * shape = view.len / itemsize
17288  * stride = itemsize
17289  */
17290  goto __pyx_L3;
17291  }
17292 
17293  /* "View.MemoryView":920
17294  * stride = itemsize
17295  * else:
17296  * shape = view.shape[dim] # <<<<<<<<<<<<<<
17297  * stride = view.strides[dim]
17298  * if view.suboffsets != NULL:
17299  */
17300  /*else*/ {
17301  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17302 
17303  /* "View.MemoryView":921
17304  * else:
17305  * shape = view.shape[dim]
17306  * stride = view.strides[dim] # <<<<<<<<<<<<<<
17307  * if view.suboffsets != NULL:
17308  * suboffset = view.suboffsets[dim]
17309  */
17310  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17311 
17312  /* "View.MemoryView":922
17313  * shape = view.shape[dim]
17314  * stride = view.strides[dim]
17315  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17316  * suboffset = view.suboffsets[dim]
17317  *
17318  */
17319  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17320  if (__pyx_t_2) {
17321 
17322  /* "View.MemoryView":923
17323  * stride = view.strides[dim]
17324  * if view.suboffsets != NULL:
17325  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
17326  *
17327  * if index < 0:
17328  */
17329  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17330 
17331  /* "View.MemoryView":922
17332  * shape = view.shape[dim]
17333  * stride = view.strides[dim]
17334  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17335  * suboffset = view.suboffsets[dim]
17336  *
17337  */
17338  }
17339  }
17340  __pyx_L3:;
17341 
17342  /* "View.MemoryView":925
17343  * suboffset = view.suboffsets[dim]
17344  *
17345  * if index < 0: # <<<<<<<<<<<<<<
17346  * index += view.shape[dim]
17347  * if index < 0:
17348  */
17349  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17350  if (__pyx_t_2) {
17351 
17352  /* "View.MemoryView":926
17353  *
17354  * if index < 0:
17355  * index += view.shape[dim] # <<<<<<<<<<<<<<
17356  * if index < 0:
17357  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17358  */
17359  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17360 
17361  /* "View.MemoryView":927
17362  * if index < 0:
17363  * index += view.shape[dim]
17364  * if index < 0: # <<<<<<<<<<<<<<
17365  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17366  *
17367  */
17368  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17369  if (unlikely(__pyx_t_2)) {
17370 
17371  /* "View.MemoryView":928
17372  * index += view.shape[dim]
17373  * if index < 0:
17374  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17375  *
17376  * if index >= shape:
17377  */
17378  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17379  __Pyx_GOTREF(__pyx_t_3);
17380  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
17381  __Pyx_GOTREF(__pyx_t_4);
17382  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17383  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17384  __Pyx_GOTREF(__pyx_t_3);
17385  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17386  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17387  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17388  __PYX_ERR(1, 928, __pyx_L1_error)
17389 
17390  /* "View.MemoryView":927
17391  * if index < 0:
17392  * index += view.shape[dim]
17393  * if index < 0: # <<<<<<<<<<<<<<
17394  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17395  *
17396  */
17397  }
17398 
17399  /* "View.MemoryView":925
17400  * suboffset = view.suboffsets[dim]
17401  *
17402  * if index < 0: # <<<<<<<<<<<<<<
17403  * index += view.shape[dim]
17404  * if index < 0:
17405  */
17406  }
17407 
17408  /* "View.MemoryView":930
17409  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17410  *
17411  * if index >= shape: # <<<<<<<<<<<<<<
17412  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17413  *
17414  */
17415  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17416  if (unlikely(__pyx_t_2)) {
17417 
17418  /* "View.MemoryView":931
17419  *
17420  * if index >= shape:
17421  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17422  *
17423  * resultp = bufp + index * stride
17424  */
17425  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17426  __Pyx_GOTREF(__pyx_t_3);
17427  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
17428  __Pyx_GOTREF(__pyx_t_4);
17429  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17430  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17431  __Pyx_GOTREF(__pyx_t_3);
17432  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17433  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17434  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17435  __PYX_ERR(1, 931, __pyx_L1_error)
17436 
17437  /* "View.MemoryView":930
17438  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17439  *
17440  * if index >= shape: # <<<<<<<<<<<<<<
17441  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17442  *
17443  */
17444  }
17445 
17446  /* "View.MemoryView":933
17447  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17448  *
17449  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
17450  * if suboffset >= 0:
17451  * resultp = (<char **> resultp)[0] + suboffset
17452  */
17453  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17454 
17455  /* "View.MemoryView":934
17456  *
17457  * resultp = bufp + index * stride
17458  * if suboffset >= 0: # <<<<<<<<<<<<<<
17459  * resultp = (<char **> resultp)[0] + suboffset
17460  *
17461  */
17462  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17463  if (__pyx_t_2) {
17464 
17465  /* "View.MemoryView":935
17466  * resultp = bufp + index * stride
17467  * if suboffset >= 0:
17468  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
17469  *
17470  * return resultp
17471  */
17472  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17473 
17474  /* "View.MemoryView":934
17475  *
17476  * resultp = bufp + index * stride
17477  * if suboffset >= 0: # <<<<<<<<<<<<<<
17478  * resultp = (<char **> resultp)[0] + suboffset
17479  *
17480  */
17481  }
17482 
17483  /* "View.MemoryView":937
17484  * resultp = (<char **> resultp)[0] + suboffset
17485  *
17486  * return resultp # <<<<<<<<<<<<<<
17487  *
17488  *
17489  */
17490  __pyx_r = __pyx_v_resultp;
17491  goto __pyx_L0;
17492 
17493  /* "View.MemoryView":910
17494  *
17495  * @cname('__pyx_pybuffer_index')
17496  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17497  * Py_ssize_t dim) except NULL:
17498  * cdef Py_ssize_t shape, stride, suboffset = -1
17499  */
17500 
17501  /* function exit code */
17502  __pyx_L1_error:;
17503  __Pyx_XDECREF(__pyx_t_3);
17504  __Pyx_XDECREF(__pyx_t_4);
17505  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17506  __pyx_r = NULL;
17507  __pyx_L0:;
17508  __Pyx_RefNannyFinishContext();
17509  return __pyx_r;
17510 }
17511 
17512 /* "View.MemoryView":943
17513  *
17514  * @cname('__pyx_memslice_transpose')
17515  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17516  * cdef int ndim = memslice.memview.view.ndim
17517  *
17518  */
17519 
17520 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17521  int __pyx_v_ndim;
17522  Py_ssize_t *__pyx_v_shape;
17523  Py_ssize_t *__pyx_v_strides;
17524  int __pyx_v_i;
17525  int __pyx_v_j;
17526  int __pyx_r;
17527  int __pyx_t_1;
17528  Py_ssize_t *__pyx_t_2;
17529  long __pyx_t_3;
17530  long __pyx_t_4;
17531  Py_ssize_t __pyx_t_5;
17532  Py_ssize_t __pyx_t_6;
17533  int __pyx_t_7;
17534  int __pyx_t_8;
17535  int __pyx_t_9;
17536  int __pyx_lineno = 0;
17537  const char *__pyx_filename = NULL;
17538  int __pyx_clineno = 0;
17539 
17540  /* "View.MemoryView":944
17541  * @cname('__pyx_memslice_transpose')
17542  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
17543  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
17544  *
17545  * cdef Py_ssize_t *shape = memslice.shape
17546  */
17547  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17548  __pyx_v_ndim = __pyx_t_1;
17549 
17550  /* "View.MemoryView":946
17551  * cdef int ndim = memslice.memview.view.ndim
17552  *
17553  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
17554  * cdef Py_ssize_t *strides = memslice.strides
17555  *
17556  */
17557  __pyx_t_2 = __pyx_v_memslice->shape;
17558  __pyx_v_shape = __pyx_t_2;
17559 
17560  /* "View.MemoryView":947
17561  *
17562  * cdef Py_ssize_t *shape = memslice.shape
17563  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
17564  *
17565  *
17566  */
17567  __pyx_t_2 = __pyx_v_memslice->strides;
17568  __pyx_v_strides = __pyx_t_2;
17569 
17570  /* "View.MemoryView":951
17571  *
17572  * cdef int i, j
17573  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
17574  * j = ndim - 1 - i
17575  * strides[i], strides[j] = strides[j], strides[i]
17576  */
17577  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17578  __pyx_t_4 = __pyx_t_3;
17579  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17580  __pyx_v_i = __pyx_t_1;
17581 
17582  /* "View.MemoryView":952
17583  * cdef int i, j
17584  * for i in range(ndim / 2):
17585  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17586  * strides[i], strides[j] = strides[j], strides[i]
17587  * shape[i], shape[j] = shape[j], shape[i]
17588  */
17589  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17590 
17591  /* "View.MemoryView":953
17592  * for i in range(ndim / 2):
17593  * j = ndim - 1 - i
17594  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17595  * shape[i], shape[j] = shape[j], shape[i]
17596  *
17597  */
17598  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17599  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17600  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17601  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17602 
17603  /* "View.MemoryView":954
17604  * j = ndim - 1 - i
17605  * strides[i], strides[j] = strides[j], strides[i]
17606  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17607  *
17608  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17609  */
17610  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17611  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17612  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17613  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17614 
17615  /* "View.MemoryView":956
17616  * shape[i], shape[j] = shape[j], shape[i]
17617  *
17618  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17619  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17620  *
17621  */
17622  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17623  if (!__pyx_t_8) {
17624  } else {
17625  __pyx_t_7 = __pyx_t_8;
17626  goto __pyx_L6_bool_binop_done;
17627  }
17628  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17629  __pyx_t_7 = __pyx_t_8;
17630  __pyx_L6_bool_binop_done:;
17631  if (__pyx_t_7) {
17632 
17633  /* "View.MemoryView":957
17634  *
17635  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17636  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17637  *
17638  * return 1
17639  */
17640  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
17641 
17642  /* "View.MemoryView":956
17643  * shape[i], shape[j] = shape[j], shape[i]
17644  *
17645  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17646  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17647  *
17648  */
17649  }
17650  }
17651 
17652  /* "View.MemoryView":959
17653  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17654  *
17655  * return 1 # <<<<<<<<<<<<<<
17656  *
17657  *
17658  */
17659  __pyx_r = 1;
17660  goto __pyx_L0;
17661 
17662  /* "View.MemoryView":943
17663  *
17664  * @cname('__pyx_memslice_transpose')
17665  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17666  * cdef int ndim = memslice.memview.view.ndim
17667  *
17668  */
17669 
17670  /* function exit code */
17671  __pyx_L1_error:;
17672  {
17673  #ifdef WITH_THREAD
17674  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17675  #endif
17676  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17677  #ifdef WITH_THREAD
17678  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17679  #endif
17680  }
17681  __pyx_r = 0;
17682  __pyx_L0:;
17683  return __pyx_r;
17684 }
17685 
17686 /* "View.MemoryView":976
17687  * cdef int (*to_dtype_func)(char *, object) except 0
17688  *
17689  * def __dealloc__(self): # <<<<<<<<<<<<<<
17690  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17691  *
17692  */
17693 
17694 /* Python wrapper */
17695 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17696 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17697  __Pyx_RefNannyDeclarations
17698  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17699  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17700 
17701  /* function exit code */
17702  __Pyx_RefNannyFinishContext();
17703 }
17704 
17705 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17706  __Pyx_RefNannyDeclarations
17707  __Pyx_RefNannySetupContext("__dealloc__", 0);
17708 
17709  /* "View.MemoryView":977
17710  *
17711  * def __dealloc__(self):
17712  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17713  *
17714  * cdef convert_item_to_object(self, char *itemp):
17715  */
17716  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17717 
17718  /* "View.MemoryView":976
17719  * cdef int (*to_dtype_func)(char *, object) except 0
17720  *
17721  * def __dealloc__(self): # <<<<<<<<<<<<<<
17722  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17723  *
17724  */
17725 
17726  /* function exit code */
17727  __Pyx_RefNannyFinishContext();
17728 }
17729 
17730 /* "View.MemoryView":979
17731  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17732  *
17733  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17734  * if self.to_object_func != NULL:
17735  * return self.to_object_func(itemp)
17736  */
17737 
17738 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17739  PyObject *__pyx_r = NULL;
17740  __Pyx_RefNannyDeclarations
17741  int __pyx_t_1;
17742  PyObject *__pyx_t_2 = NULL;
17743  int __pyx_lineno = 0;
17744  const char *__pyx_filename = NULL;
17745  int __pyx_clineno = 0;
17746  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17747 
17748  /* "View.MemoryView":980
17749  *
17750  * cdef convert_item_to_object(self, char *itemp):
17751  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17752  * return self.to_object_func(itemp)
17753  * else:
17754  */
17755  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17756  if (__pyx_t_1) {
17757 
17758  /* "View.MemoryView":981
17759  * cdef convert_item_to_object(self, char *itemp):
17760  * if self.to_object_func != NULL:
17761  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17762  * else:
17763  * return memoryview.convert_item_to_object(self, itemp)
17764  */
17765  __Pyx_XDECREF(__pyx_r);
17766  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
17767  __Pyx_GOTREF(__pyx_t_2);
17768  __pyx_r = __pyx_t_2;
17769  __pyx_t_2 = 0;
17770  goto __pyx_L0;
17771 
17772  /* "View.MemoryView":980
17773  *
17774  * cdef convert_item_to_object(self, char *itemp):
17775  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17776  * return self.to_object_func(itemp)
17777  * else:
17778  */
17779  }
17780 
17781  /* "View.MemoryView":983
17782  * return self.to_object_func(itemp)
17783  * else:
17784  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17785  *
17786  * cdef assign_item_from_object(self, char *itemp, object value):
17787  */
17788  /*else*/ {
17789  __Pyx_XDECREF(__pyx_r);
17790  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
17791  __Pyx_GOTREF(__pyx_t_2);
17792  __pyx_r = __pyx_t_2;
17793  __pyx_t_2 = 0;
17794  goto __pyx_L0;
17795  }
17796 
17797  /* "View.MemoryView":979
17798  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17799  *
17800  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17801  * if self.to_object_func != NULL:
17802  * return self.to_object_func(itemp)
17803  */
17804 
17805  /* function exit code */
17806  __pyx_L1_error:;
17807  __Pyx_XDECREF(__pyx_t_2);
17808  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17809  __pyx_r = 0;
17810  __pyx_L0:;
17811  __Pyx_XGIVEREF(__pyx_r);
17812  __Pyx_RefNannyFinishContext();
17813  return __pyx_r;
17814 }
17815 
17816 /* "View.MemoryView":985
17817  * return memoryview.convert_item_to_object(self, itemp)
17818  *
17819  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17820  * if self.to_dtype_func != NULL:
17821  * self.to_dtype_func(itemp, value)
17822  */
17823 
17824 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17825  PyObject *__pyx_r = NULL;
17826  __Pyx_RefNannyDeclarations
17827  int __pyx_t_1;
17828  int __pyx_t_2;
17829  PyObject *__pyx_t_3 = NULL;
17830  int __pyx_lineno = 0;
17831  const char *__pyx_filename = NULL;
17832  int __pyx_clineno = 0;
17833  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17834 
17835  /* "View.MemoryView":986
17836  *
17837  * cdef assign_item_from_object(self, char *itemp, object value):
17838  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17839  * self.to_dtype_func(itemp, value)
17840  * else:
17841  */
17842  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17843  if (__pyx_t_1) {
17844 
17845  /* "View.MemoryView":987
17846  * cdef assign_item_from_object(self, char *itemp, object value):
17847  * if self.to_dtype_func != NULL:
17848  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17849  * else:
17850  * memoryview.assign_item_from_object(self, itemp, value)
17851  */
17852  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
17853 
17854  /* "View.MemoryView":986
17855  *
17856  * cdef assign_item_from_object(self, char *itemp, object value):
17857  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17858  * self.to_dtype_func(itemp, value)
17859  * else:
17860  */
17861  goto __pyx_L3;
17862  }
17863 
17864  /* "View.MemoryView":989
17865  * self.to_dtype_func(itemp, value)
17866  * else:
17867  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17868  *
17869  * @property
17870  */
17871  /*else*/ {
17872  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
17873  __Pyx_GOTREF(__pyx_t_3);
17874  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17875  }
17876  __pyx_L3:;
17877 
17878  /* "View.MemoryView":985
17879  * return memoryview.convert_item_to_object(self, itemp)
17880  *
17881  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17882  * if self.to_dtype_func != NULL:
17883  * self.to_dtype_func(itemp, value)
17884  */
17885 
17886  /* function exit code */
17887  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17888  goto __pyx_L0;
17889  __pyx_L1_error:;
17890  __Pyx_XDECREF(__pyx_t_3);
17891  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17892  __pyx_r = 0;
17893  __pyx_L0:;
17894  __Pyx_XGIVEREF(__pyx_r);
17895  __Pyx_RefNannyFinishContext();
17896  return __pyx_r;
17897 }
17898 
17899 /* "View.MemoryView":992
17900  *
17901  * @property
17902  * def base(self): # <<<<<<<<<<<<<<
17903  * return self.from_object
17904  *
17905  */
17906 
17907 /* Python wrapper */
17908 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17909 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17910  PyObject *__pyx_r = 0;
17911  __Pyx_RefNannyDeclarations
17912  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17913  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17914 
17915  /* function exit code */
17916  __Pyx_RefNannyFinishContext();
17917  return __pyx_r;
17918 }
17919 
17920 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17921  PyObject *__pyx_r = NULL;
17922  __Pyx_RefNannyDeclarations
17923  __Pyx_RefNannySetupContext("__get__", 0);
17924 
17925  /* "View.MemoryView":993
17926  * @property
17927  * def base(self):
17928  * return self.from_object # <<<<<<<<<<<<<<
17929  *
17930  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17931  */
17932  __Pyx_XDECREF(__pyx_r);
17933  __Pyx_INCREF(__pyx_v_self->from_object);
17934  __pyx_r = __pyx_v_self->from_object;
17935  goto __pyx_L0;
17936 
17937  /* "View.MemoryView":992
17938  *
17939  * @property
17940  * def base(self): # <<<<<<<<<<<<<<
17941  * return self.from_object
17942  *
17943  */
17944 
17945  /* function exit code */
17946  __pyx_L0:;
17947  __Pyx_XGIVEREF(__pyx_r);
17948  __Pyx_RefNannyFinishContext();
17949  return __pyx_r;
17950 }
17951 
17952 /* "(tree fragment)":1
17953  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17954  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17955  * def __setstate_cython__(self, __pyx_state):
17956  */
17957 
17958 /* Python wrapper */
17959 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17960 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17961  PyObject *__pyx_r = 0;
17962  __Pyx_RefNannyDeclarations
17963  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17964  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17965 
17966  /* function exit code */
17967  __Pyx_RefNannyFinishContext();
17968  return __pyx_r;
17969 }
17970 
17971 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17972  PyObject *__pyx_r = NULL;
17973  __Pyx_RefNannyDeclarations
17974  PyObject *__pyx_t_1 = NULL;
17975  int __pyx_lineno = 0;
17976  const char *__pyx_filename = NULL;
17977  int __pyx_clineno = 0;
17978  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17979 
17980  /* "(tree fragment)":2
17981  * def __reduce_cython__(self):
17982  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17983  * def __setstate_cython__(self, __pyx_state):
17984  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17985  */
17986  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17987  __Pyx_GOTREF(__pyx_t_1);
17988  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17989  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17990  __PYX_ERR(1, 2, __pyx_L1_error)
17991 
17992  /* "(tree fragment)":1
17993  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17994  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17995  * def __setstate_cython__(self, __pyx_state):
17996  */
17997 
17998  /* function exit code */
17999  __pyx_L1_error:;
18000  __Pyx_XDECREF(__pyx_t_1);
18001  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18002  __pyx_r = NULL;
18003  __Pyx_XGIVEREF(__pyx_r);
18004  __Pyx_RefNannyFinishContext();
18005  return __pyx_r;
18006 }
18007 
18008 /* "(tree fragment)":3
18009  * def __reduce_cython__(self):
18010  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18011  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18012  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18013  */
18014 
18015 /* Python wrapper */
18016 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
18017 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18018  PyObject *__pyx_r = 0;
18019  __Pyx_RefNannyDeclarations
18020  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
18021  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18022 
18023  /* function exit code */
18024  __Pyx_RefNannyFinishContext();
18025  return __pyx_r;
18026 }
18027 
18028 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18029  PyObject *__pyx_r = NULL;
18030  __Pyx_RefNannyDeclarations
18031  PyObject *__pyx_t_1 = NULL;
18032  int __pyx_lineno = 0;
18033  const char *__pyx_filename = NULL;
18034  int __pyx_clineno = 0;
18035  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
18036 
18037  /* "(tree fragment)":4
18038  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18039  * def __setstate_cython__(self, __pyx_state):
18040  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18041  */
18042  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18043  __Pyx_GOTREF(__pyx_t_1);
18044  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18045  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18046  __PYX_ERR(1, 4, __pyx_L1_error)
18047 
18048  /* "(tree fragment)":3
18049  * def __reduce_cython__(self):
18050  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18051  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18052  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18053  */
18054 
18055  /* function exit code */
18056  __pyx_L1_error:;
18057  __Pyx_XDECREF(__pyx_t_1);
18058  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18059  __pyx_r = NULL;
18060  __Pyx_XGIVEREF(__pyx_r);
18061  __Pyx_RefNannyFinishContext();
18062  return __pyx_r;
18063 }
18064 
18065 /* "View.MemoryView":999
18066  *
18067  * @cname('__pyx_memoryview_fromslice')
18068  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18069  * int ndim,
18070  * object (*to_object_func)(char *),
18071  */
18072 
18073 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
18074  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
18075  Py_ssize_t __pyx_v_suboffset;
18076  PyObject *__pyx_v_length = NULL;
18077  PyObject *__pyx_r = NULL;
18078  __Pyx_RefNannyDeclarations
18079  int __pyx_t_1;
18080  PyObject *__pyx_t_2 = NULL;
18081  PyObject *__pyx_t_3 = NULL;
18082  __Pyx_TypeInfo *__pyx_t_4;
18083  Py_buffer __pyx_t_5;
18084  Py_ssize_t *__pyx_t_6;
18085  Py_ssize_t *__pyx_t_7;
18086  Py_ssize_t *__pyx_t_8;
18087  Py_ssize_t __pyx_t_9;
18088  int __pyx_lineno = 0;
18089  const char *__pyx_filename = NULL;
18090  int __pyx_clineno = 0;
18091  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
18092 
18093  /* "View.MemoryView":1007
18094  * cdef _memoryviewslice result
18095  *
18096  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
18097  * return None
18098  *
18099  */
18100  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
18101  if (__pyx_t_1) {
18102 
18103  /* "View.MemoryView":1008
18104  *
18105  * if <PyObject *> memviewslice.memview == Py_None:
18106  * return None # <<<<<<<<<<<<<<
18107  *
18108  *
18109  */
18110  __Pyx_XDECREF(__pyx_r);
18111  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18112  goto __pyx_L0;
18113 
18114  /* "View.MemoryView":1007
18115  * cdef _memoryviewslice result
18116  *
18117  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
18118  * return None
18119  *
18120  */
18121  }
18122 
18123  /* "View.MemoryView":1013
18124  *
18125  *
18126  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
18127  *
18128  * result.from_slice = memviewslice
18129  */
18130  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
18131  __Pyx_GOTREF(__pyx_t_2);
18132  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
18133  __Pyx_GOTREF(__pyx_t_3);
18134  __Pyx_INCREF(Py_None);
18135  __Pyx_GIVEREF(Py_None);
18136  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
18137  __Pyx_INCREF(__pyx_int_0);
18138  __Pyx_GIVEREF(__pyx_int_0);
18139  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
18140  __Pyx_GIVEREF(__pyx_t_2);
18141  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18142  __pyx_t_2 = 0;
18143  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
18144  __Pyx_GOTREF(__pyx_t_2);
18145  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18146  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
18147  __pyx_t_2 = 0;
18148 
18149  /* "View.MemoryView":1015
18150  * result = _memoryviewslice(None, 0, dtype_is_object)
18151  *
18152  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
18153  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18154  *
18155  */
18156  __pyx_v_result->from_slice = __pyx_v_memviewslice;
18157 
18158  /* "View.MemoryView":1016
18159  *
18160  * result.from_slice = memviewslice
18161  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
18162  *
18163  * result.from_object = (<memoryview> memviewslice.memview).base
18164  */
18165  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
18166 
18167  /* "View.MemoryView":1018
18168  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18169  *
18170  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
18171  * result.typeinfo = memviewslice.memview.typeinfo
18172  *
18173  */
18174  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
18175  __Pyx_GOTREF(__pyx_t_2);
18176  __Pyx_GIVEREF(__pyx_t_2);
18177  __Pyx_GOTREF(__pyx_v_result->from_object);
18178  __Pyx_DECREF(__pyx_v_result->from_object);
18179  __pyx_v_result->from_object = __pyx_t_2;
18180  __pyx_t_2 = 0;
18181 
18182  /* "View.MemoryView":1019
18183  *
18184  * result.from_object = (<memoryview> memviewslice.memview).base
18185  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
18186  *
18187  * result.view = memviewslice.memview.view
18188  */
18189  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
18190  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
18191 
18192  /* "View.MemoryView":1021
18193  * result.typeinfo = memviewslice.memview.typeinfo
18194  *
18195  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
18196  * result.view.buf = <void *> memviewslice.data
18197  * result.view.ndim = ndim
18198  */
18199  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
18200  __pyx_v_result->__pyx_base.view = __pyx_t_5;
18201 
18202  /* "View.MemoryView":1022
18203  *
18204  * result.view = memviewslice.memview.view
18205  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
18206  * result.view.ndim = ndim
18207  * (<__pyx_buffer *> &result.view).obj = Py_None
18208  */
18209  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
18210 
18211  /* "View.MemoryView":1023
18212  * result.view = memviewslice.memview.view
18213  * result.view.buf = <void *> memviewslice.data
18214  * result.view.ndim = ndim # <<<<<<<<<<<<<<
18215  * (<__pyx_buffer *> &result.view).obj = Py_None
18216  * Py_INCREF(Py_None)
18217  */
18218  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18219 
18220  /* "View.MemoryView":1024
18221  * result.view.buf = <void *> memviewslice.data
18222  * result.view.ndim = ndim
18223  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
18224  * Py_INCREF(Py_None)
18225  *
18226  */
18227  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18228 
18229  /* "View.MemoryView":1025
18230  * result.view.ndim = ndim
18231  * (<__pyx_buffer *> &result.view).obj = Py_None
18232  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
18233  *
18234  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18235  */
18236  Py_INCREF(Py_None);
18237 
18238  /* "View.MemoryView":1027
18239  * Py_INCREF(Py_None)
18240  *
18241  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18242  * result.flags = PyBUF_RECORDS
18243  * else:
18244  */
18245  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18246  if (__pyx_t_1) {
18247 
18248  /* "View.MemoryView":1028
18249  *
18250  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18251  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
18252  * else:
18253  * result.flags = PyBUF_RECORDS_RO
18254  */
18255  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18256 
18257  /* "View.MemoryView":1027
18258  * Py_INCREF(Py_None)
18259  *
18260  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18261  * result.flags = PyBUF_RECORDS
18262  * else:
18263  */
18264  goto __pyx_L4;
18265  }
18266 
18267  /* "View.MemoryView":1030
18268  * result.flags = PyBUF_RECORDS
18269  * else:
18270  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
18271  *
18272  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18273  */
18274  /*else*/ {
18275  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18276  }
18277  __pyx_L4:;
18278 
18279  /* "View.MemoryView":1032
18280  * result.flags = PyBUF_RECORDS_RO
18281  *
18282  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
18283  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
18284  *
18285  */
18286  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18287 
18288  /* "View.MemoryView":1033
18289  *
18290  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18291  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
18292  *
18293  *
18294  */
18295  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18296 
18297  /* "View.MemoryView":1036
18298  *
18299  *
18300  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
18301  * for suboffset in result.from_slice.suboffsets[:ndim]:
18302  * if suboffset >= 0:
18303  */
18304  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18305 
18306  /* "View.MemoryView":1037
18307  *
18308  * result.view.suboffsets = NULL
18309  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
18310  * if suboffset >= 0:
18311  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18312  */
18313  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18314  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18315  __pyx_t_6 = __pyx_t_8;
18316  __pyx_v_suboffset = (__pyx_t_6[0]);
18317 
18318  /* "View.MemoryView":1038
18319  * result.view.suboffsets = NULL
18320  * for suboffset in result.from_slice.suboffsets[:ndim]:
18321  * if suboffset >= 0: # <<<<<<<<<<<<<<
18322  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18323  * break
18324  */
18325  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18326  if (__pyx_t_1) {
18327 
18328  /* "View.MemoryView":1039
18329  * for suboffset in result.from_slice.suboffsets[:ndim]:
18330  * if suboffset >= 0:
18331  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
18332  * break
18333  *
18334  */
18335  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18336 
18337  /* "View.MemoryView":1040
18338  * if suboffset >= 0:
18339  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18340  * break # <<<<<<<<<<<<<<
18341  *
18342  * result.view.len = result.view.itemsize
18343  */
18344  goto __pyx_L6_break;
18345 
18346  /* "View.MemoryView":1038
18347  * result.view.suboffsets = NULL
18348  * for suboffset in result.from_slice.suboffsets[:ndim]:
18349  * if suboffset >= 0: # <<<<<<<<<<<<<<
18350  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18351  * break
18352  */
18353  }
18354  }
18355  __pyx_L6_break:;
18356 
18357  /* "View.MemoryView":1042
18358  * break
18359  *
18360  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
18361  * for length in result.view.shape[:ndim]:
18362  * result.view.len *= length
18363  */
18364  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18365  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18366 
18367  /* "View.MemoryView":1043
18368  *
18369  * result.view.len = result.view.itemsize
18370  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
18371  * result.view.len *= length
18372  *
18373  */
18374  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18375  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18376  __pyx_t_6 = __pyx_t_8;
18377  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
18378  __Pyx_GOTREF(__pyx_t_2);
18379  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18380  __pyx_t_2 = 0;
18381 
18382  /* "View.MemoryView":1044
18383  * result.view.len = result.view.itemsize
18384  * for length in result.view.shape[:ndim]:
18385  * result.view.len *= length # <<<<<<<<<<<<<<
18386  *
18387  * result.to_object_func = to_object_func
18388  */
18389  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
18390  __Pyx_GOTREF(__pyx_t_2);
18391  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
18392  __Pyx_GOTREF(__pyx_t_3);
18393  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18394  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
18395  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18396  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18397  }
18398 
18399  /* "View.MemoryView":1046
18400  * result.view.len *= length
18401  *
18402  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
18403  * result.to_dtype_func = to_dtype_func
18404  *
18405  */
18406  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18407 
18408  /* "View.MemoryView":1047
18409  *
18410  * result.to_object_func = to_object_func
18411  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
18412  *
18413  * return result
18414  */
18415  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18416 
18417  /* "View.MemoryView":1049
18418  * result.to_dtype_func = to_dtype_func
18419  *
18420  * return result # <<<<<<<<<<<<<<
18421  *
18422  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18423  */
18424  __Pyx_XDECREF(__pyx_r);
18425  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18426  __pyx_r = ((PyObject *)__pyx_v_result);
18427  goto __pyx_L0;
18428 
18429  /* "View.MemoryView":999
18430  *
18431  * @cname('__pyx_memoryview_fromslice')
18432  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18433  * int ndim,
18434  * object (*to_object_func)(char *),
18435  */
18436 
18437  /* function exit code */
18438  __pyx_L1_error:;
18439  __Pyx_XDECREF(__pyx_t_2);
18440  __Pyx_XDECREF(__pyx_t_3);
18441  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18442  __pyx_r = 0;
18443  __pyx_L0:;
18444  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18445  __Pyx_XDECREF(__pyx_v_length);
18446  __Pyx_XGIVEREF(__pyx_r);
18447  __Pyx_RefNannyFinishContext();
18448  return __pyx_r;
18449 }
18450 
18451 /* "View.MemoryView":1052
18452  *
18453  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18454  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18455  * __Pyx_memviewslice *mslice) except NULL:
18456  * cdef _memoryviewslice obj
18457  */
18458 
18459 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18460  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18461  __Pyx_memviewslice *__pyx_r;
18462  __Pyx_RefNannyDeclarations
18463  int __pyx_t_1;
18464  int __pyx_t_2;
18465  PyObject *__pyx_t_3 = NULL;
18466  int __pyx_lineno = 0;
18467  const char *__pyx_filename = NULL;
18468  int __pyx_clineno = 0;
18469  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
18470 
18471  /* "View.MemoryView":1055
18472  * __Pyx_memviewslice *mslice) except NULL:
18473  * cdef _memoryviewslice obj
18474  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18475  * obj = memview
18476  * return &obj.from_slice
18477  */
18478  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18479  __pyx_t_2 = (__pyx_t_1 != 0);
18480  if (__pyx_t_2) {
18481 
18482  /* "View.MemoryView":1056
18483  * cdef _memoryviewslice obj
18484  * if isinstance(memview, _memoryviewslice):
18485  * obj = memview # <<<<<<<<<<<<<<
18486  * return &obj.from_slice
18487  * else:
18488  */
18489  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
18490  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18491  __Pyx_INCREF(__pyx_t_3);
18492  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18493  __pyx_t_3 = 0;
18494 
18495  /* "View.MemoryView":1057
18496  * if isinstance(memview, _memoryviewslice):
18497  * obj = memview
18498  * return &obj.from_slice # <<<<<<<<<<<<<<
18499  * else:
18500  * slice_copy(memview, mslice)
18501  */
18502  __pyx_r = (&__pyx_v_obj->from_slice);
18503  goto __pyx_L0;
18504 
18505  /* "View.MemoryView":1055
18506  * __Pyx_memviewslice *mslice) except NULL:
18507  * cdef _memoryviewslice obj
18508  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18509  * obj = memview
18510  * return &obj.from_slice
18511  */
18512  }
18513 
18514  /* "View.MemoryView":1059
18515  * return &obj.from_slice
18516  * else:
18517  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
18518  * return mslice
18519  *
18520  */
18521  /*else*/ {
18522  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18523 
18524  /* "View.MemoryView":1060
18525  * else:
18526  * slice_copy(memview, mslice)
18527  * return mslice # <<<<<<<<<<<<<<
18528  *
18529  * @cname('__pyx_memoryview_slice_copy')
18530  */
18531  __pyx_r = __pyx_v_mslice;
18532  goto __pyx_L0;
18533  }
18534 
18535  /* "View.MemoryView":1052
18536  *
18537  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18538  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18539  * __Pyx_memviewslice *mslice) except NULL:
18540  * cdef _memoryviewslice obj
18541  */
18542 
18543  /* function exit code */
18544  __pyx_L1_error:;
18545  __Pyx_XDECREF(__pyx_t_3);
18546  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18547  __pyx_r = NULL;
18548  __pyx_L0:;
18549  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18550  __Pyx_RefNannyFinishContext();
18551  return __pyx_r;
18552 }
18553 
18554 /* "View.MemoryView":1063
18555  *
18556  * @cname('__pyx_memoryview_slice_copy')
18557  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18558  * cdef int dim
18559  * cdef (Py_ssize_t*) shape, strides, suboffsets
18560  */
18561 
18562 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18563  int __pyx_v_dim;
18564  Py_ssize_t *__pyx_v_shape;
18565  Py_ssize_t *__pyx_v_strides;
18566  Py_ssize_t *__pyx_v_suboffsets;
18567  __Pyx_RefNannyDeclarations
18568  Py_ssize_t *__pyx_t_1;
18569  int __pyx_t_2;
18570  int __pyx_t_3;
18571  int __pyx_t_4;
18572  Py_ssize_t __pyx_t_5;
18573  __Pyx_RefNannySetupContext("slice_copy", 0);
18574 
18575  /* "View.MemoryView":1067
18576  * cdef (Py_ssize_t*) shape, strides, suboffsets
18577  *
18578  * shape = memview.view.shape # <<<<<<<<<<<<<<
18579  * strides = memview.view.strides
18580  * suboffsets = memview.view.suboffsets
18581  */
18582  __pyx_t_1 = __pyx_v_memview->view.shape;
18583  __pyx_v_shape = __pyx_t_1;
18584 
18585  /* "View.MemoryView":1068
18586  *
18587  * shape = memview.view.shape
18588  * strides = memview.view.strides # <<<<<<<<<<<<<<
18589  * suboffsets = memview.view.suboffsets
18590  *
18591  */
18592  __pyx_t_1 = __pyx_v_memview->view.strides;
18593  __pyx_v_strides = __pyx_t_1;
18594 
18595  /* "View.MemoryView":1069
18596  * shape = memview.view.shape
18597  * strides = memview.view.strides
18598  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18599  *
18600  * dst.memview = <__pyx_memoryview *> memview
18601  */
18602  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18603  __pyx_v_suboffsets = __pyx_t_1;
18604 
18605  /* "View.MemoryView":1071
18606  * suboffsets = memview.view.suboffsets
18607  *
18608  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18609  * dst.data = <char *> memview.view.buf
18610  *
18611  */
18612  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18613 
18614  /* "View.MemoryView":1072
18615  *
18616  * dst.memview = <__pyx_memoryview *> memview
18617  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18618  *
18619  * for dim in range(memview.view.ndim):
18620  */
18621  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18622 
18623  /* "View.MemoryView":1074
18624  * dst.data = <char *> memview.view.buf
18625  *
18626  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18627  * dst.shape[dim] = shape[dim]
18628  * dst.strides[dim] = strides[dim]
18629  */
18630  __pyx_t_2 = __pyx_v_memview->view.ndim;
18631  __pyx_t_3 = __pyx_t_2;
18632  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18633  __pyx_v_dim = __pyx_t_4;
18634 
18635  /* "View.MemoryView":1075
18636  *
18637  * for dim in range(memview.view.ndim):
18638  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18639  * dst.strides[dim] = strides[dim]
18640  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18641  */
18642  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18643 
18644  /* "View.MemoryView":1076
18645  * for dim in range(memview.view.ndim):
18646  * dst.shape[dim] = shape[dim]
18647  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18648  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18649  *
18650  */
18651  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18652 
18653  /* "View.MemoryView":1077
18654  * dst.shape[dim] = shape[dim]
18655  * dst.strides[dim] = strides[dim]
18656  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18657  *
18658  * @cname('__pyx_memoryview_copy_object')
18659  */
18660  if ((__pyx_v_suboffsets != 0)) {
18661  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18662  } else {
18663  __pyx_t_5 = -1L;
18664  }
18665  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18666  }
18667 
18668  /* "View.MemoryView":1063
18669  *
18670  * @cname('__pyx_memoryview_slice_copy')
18671  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18672  * cdef int dim
18673  * cdef (Py_ssize_t*) shape, strides, suboffsets
18674  */
18675 
18676  /* function exit code */
18677  __Pyx_RefNannyFinishContext();
18678 }
18679 
18680 /* "View.MemoryView":1080
18681  *
18682  * @cname('__pyx_memoryview_copy_object')
18683  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18684  * "Create a new memoryview object"
18685  * cdef __Pyx_memviewslice memviewslice
18686  */
18687 
18688 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18689  __Pyx_memviewslice __pyx_v_memviewslice;
18690  PyObject *__pyx_r = NULL;
18691  __Pyx_RefNannyDeclarations
18692  PyObject *__pyx_t_1 = NULL;
18693  int __pyx_lineno = 0;
18694  const char *__pyx_filename = NULL;
18695  int __pyx_clineno = 0;
18696  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18697 
18698  /* "View.MemoryView":1083
18699  * "Create a new memoryview object"
18700  * cdef __Pyx_memviewslice memviewslice
18701  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18702  * return memoryview_copy_from_slice(memview, &memviewslice)
18703  *
18704  */
18705  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18706 
18707  /* "View.MemoryView":1084
18708  * cdef __Pyx_memviewslice memviewslice
18709  * slice_copy(memview, &memviewslice)
18710  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18711  *
18712  * @cname('__pyx_memoryview_copy_object_from_slice')
18713  */
18714  __Pyx_XDECREF(__pyx_r);
18715  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
18716  __Pyx_GOTREF(__pyx_t_1);
18717  __pyx_r = __pyx_t_1;
18718  __pyx_t_1 = 0;
18719  goto __pyx_L0;
18720 
18721  /* "View.MemoryView":1080
18722  *
18723  * @cname('__pyx_memoryview_copy_object')
18724  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18725  * "Create a new memoryview object"
18726  * cdef __Pyx_memviewslice memviewslice
18727  */
18728 
18729  /* function exit code */
18730  __pyx_L1_error:;
18731  __Pyx_XDECREF(__pyx_t_1);
18732  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18733  __pyx_r = 0;
18734  __pyx_L0:;
18735  __Pyx_XGIVEREF(__pyx_r);
18736  __Pyx_RefNannyFinishContext();
18737  return __pyx_r;
18738 }
18739 
18740 /* "View.MemoryView":1087
18741  *
18742  * @cname('__pyx_memoryview_copy_object_from_slice')
18743  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18744  * """
18745  * Create a new memoryview object from a given memoryview object and slice.
18746  */
18747 
18748 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18749  PyObject *(*__pyx_v_to_object_func)(char *);
18750  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18751  PyObject *__pyx_r = NULL;
18752  __Pyx_RefNannyDeclarations
18753  int __pyx_t_1;
18754  int __pyx_t_2;
18755  PyObject *(*__pyx_t_3)(char *);
18756  int (*__pyx_t_4)(char *, PyObject *);
18757  PyObject *__pyx_t_5 = NULL;
18758  int __pyx_lineno = 0;
18759  const char *__pyx_filename = NULL;
18760  int __pyx_clineno = 0;
18761  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18762 
18763  /* "View.MemoryView":1094
18764  * cdef int (*to_dtype_func)(char *, object) except 0
18765  *
18766  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18767  * to_object_func = (<_memoryviewslice> memview).to_object_func
18768  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18769  */
18770  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18771  __pyx_t_2 = (__pyx_t_1 != 0);
18772  if (__pyx_t_2) {
18773 
18774  /* "View.MemoryView":1095
18775  *
18776  * if isinstance(memview, _memoryviewslice):
18777  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18778  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18779  * else:
18780  */
18781  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18782  __pyx_v_to_object_func = __pyx_t_3;
18783 
18784  /* "View.MemoryView":1096
18785  * if isinstance(memview, _memoryviewslice):
18786  * to_object_func = (<_memoryviewslice> memview).to_object_func
18787  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18788  * else:
18789  * to_object_func = NULL
18790  */
18791  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18792  __pyx_v_to_dtype_func = __pyx_t_4;
18793 
18794  /* "View.MemoryView":1094
18795  * cdef int (*to_dtype_func)(char *, object) except 0
18796  *
18797  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18798  * to_object_func = (<_memoryviewslice> memview).to_object_func
18799  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18800  */
18801  goto __pyx_L3;
18802  }
18803 
18804  /* "View.MemoryView":1098
18805  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18806  * else:
18807  * to_object_func = NULL # <<<<<<<<<<<<<<
18808  * to_dtype_func = NULL
18809  *
18810  */
18811  /*else*/ {
18812  __pyx_v_to_object_func = NULL;
18813 
18814  /* "View.MemoryView":1099
18815  * else:
18816  * to_object_func = NULL
18817  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18818  *
18819  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18820  */
18821  __pyx_v_to_dtype_func = NULL;
18822  }
18823  __pyx_L3:;
18824 
18825  /* "View.MemoryView":1101
18826  * to_dtype_func = NULL
18827  *
18828  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18829  * to_object_func, to_dtype_func,
18830  * memview.dtype_is_object)
18831  */
18832  __Pyx_XDECREF(__pyx_r);
18833 
18834  /* "View.MemoryView":1103
18835  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18836  * to_object_func, to_dtype_func,
18837  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18838  *
18839  *
18840  */
18841  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
18842  __Pyx_GOTREF(__pyx_t_5);
18843  __pyx_r = __pyx_t_5;
18844  __pyx_t_5 = 0;
18845  goto __pyx_L0;
18846 
18847  /* "View.MemoryView":1087
18848  *
18849  * @cname('__pyx_memoryview_copy_object_from_slice')
18850  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18851  * """
18852  * Create a new memoryview object from a given memoryview object and slice.
18853  */
18854 
18855  /* function exit code */
18856  __pyx_L1_error:;
18857  __Pyx_XDECREF(__pyx_t_5);
18858  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18859  __pyx_r = 0;
18860  __pyx_L0:;
18861  __Pyx_XGIVEREF(__pyx_r);
18862  __Pyx_RefNannyFinishContext();
18863  return __pyx_r;
18864 }
18865 
18866 /* "View.MemoryView":1109
18867  *
18868  *
18869  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18870  * if arg < 0:
18871  * return -arg
18872  */
18873 
18874 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18875  Py_ssize_t __pyx_r;
18876  int __pyx_t_1;
18877 
18878  /* "View.MemoryView":1110
18879  *
18880  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18881  * if arg < 0: # <<<<<<<<<<<<<<
18882  * return -arg
18883  * else:
18884  */
18885  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18886  if (__pyx_t_1) {
18887 
18888  /* "View.MemoryView":1111
18889  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18890  * if arg < 0:
18891  * return -arg # <<<<<<<<<<<<<<
18892  * else:
18893  * return arg
18894  */
18895  __pyx_r = (-__pyx_v_arg);
18896  goto __pyx_L0;
18897 
18898  /* "View.MemoryView":1110
18899  *
18900  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18901  * if arg < 0: # <<<<<<<<<<<<<<
18902  * return -arg
18903  * else:
18904  */
18905  }
18906 
18907  /* "View.MemoryView":1113
18908  * return -arg
18909  * else:
18910  * return arg # <<<<<<<<<<<<<<
18911  *
18912  * @cname('__pyx_get_best_slice_order')
18913  */
18914  /*else*/ {
18915  __pyx_r = __pyx_v_arg;
18916  goto __pyx_L0;
18917  }
18918 
18919  /* "View.MemoryView":1109
18920  *
18921  *
18922  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18923  * if arg < 0:
18924  * return -arg
18925  */
18926 
18927  /* function exit code */
18928  __pyx_L0:;
18929  return __pyx_r;
18930 }
18931 
18932 /* "View.MemoryView":1116
18933  *
18934  * @cname('__pyx_get_best_slice_order')
18935  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18936  * """
18937  * Figure out the best memory access order for a given slice.
18938  */
18939 
18940 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18941  int __pyx_v_i;
18942  Py_ssize_t __pyx_v_c_stride;
18943  Py_ssize_t __pyx_v_f_stride;
18944  char __pyx_r;
18945  int __pyx_t_1;
18946  int __pyx_t_2;
18947  int __pyx_t_3;
18948  int __pyx_t_4;
18949 
18950  /* "View.MemoryView":1121
18951  * """
18952  * cdef int i
18953  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18954  * cdef Py_ssize_t f_stride = 0
18955  *
18956  */
18957  __pyx_v_c_stride = 0;
18958 
18959  /* "View.MemoryView":1122
18960  * cdef int i
18961  * cdef Py_ssize_t c_stride = 0
18962  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18963  *
18964  * for i in range(ndim - 1, -1, -1):
18965  */
18966  __pyx_v_f_stride = 0;
18967 
18968  /* "View.MemoryView":1124
18969  * cdef Py_ssize_t f_stride = 0
18970  *
18971  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18972  * if mslice.shape[i] > 1:
18973  * c_stride = mslice.strides[i]
18974  */
18975  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18976  __pyx_v_i = __pyx_t_1;
18977 
18978  /* "View.MemoryView":1125
18979  *
18980  * for i in range(ndim - 1, -1, -1):
18981  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18982  * c_stride = mslice.strides[i]
18983  * break
18984  */
18985  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18986  if (__pyx_t_2) {
18987 
18988  /* "View.MemoryView":1126
18989  * for i in range(ndim - 1, -1, -1):
18990  * if mslice.shape[i] > 1:
18991  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18992  * break
18993  *
18994  */
18995  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18996 
18997  /* "View.MemoryView":1127
18998  * if mslice.shape[i] > 1:
18999  * c_stride = mslice.strides[i]
19000  * break # <<<<<<<<<<<<<<
19001  *
19002  * for i in range(ndim):
19003  */
19004  goto __pyx_L4_break;
19005 
19006  /* "View.MemoryView":1125
19007  *
19008  * for i in range(ndim - 1, -1, -1):
19009  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19010  * c_stride = mslice.strides[i]
19011  * break
19012  */
19013  }
19014  }
19015  __pyx_L4_break:;
19016 
19017  /* "View.MemoryView":1129
19018  * break
19019  *
19020  * for i in range(ndim): # <<<<<<<<<<<<<<
19021  * if mslice.shape[i] > 1:
19022  * f_stride = mslice.strides[i]
19023  */
19024  __pyx_t_1 = __pyx_v_ndim;
19025  __pyx_t_3 = __pyx_t_1;
19026  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19027  __pyx_v_i = __pyx_t_4;
19028 
19029  /* "View.MemoryView":1130
19030  *
19031  * for i in range(ndim):
19032  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19033  * f_stride = mslice.strides[i]
19034  * break
19035  */
19036  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19037  if (__pyx_t_2) {
19038 
19039  /* "View.MemoryView":1131
19040  * for i in range(ndim):
19041  * if mslice.shape[i] > 1:
19042  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
19043  * break
19044  *
19045  */
19046  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19047 
19048  /* "View.MemoryView":1132
19049  * if mslice.shape[i] > 1:
19050  * f_stride = mslice.strides[i]
19051  * break # <<<<<<<<<<<<<<
19052  *
19053  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
19054  */
19055  goto __pyx_L7_break;
19056 
19057  /* "View.MemoryView":1130
19058  *
19059  * for i in range(ndim):
19060  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19061  * f_stride = mslice.strides[i]
19062  * break
19063  */
19064  }
19065  }
19066  __pyx_L7_break:;
19067 
19068  /* "View.MemoryView":1134
19069  * break
19070  *
19071  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
19072  * return 'C'
19073  * else:
19074  */
19075  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
19076  if (__pyx_t_2) {
19077 
19078  /* "View.MemoryView":1135
19079  *
19080  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
19081  * return 'C' # <<<<<<<<<<<<<<
19082  * else:
19083  * return 'F'
19084  */
19085  __pyx_r = 'C';
19086  goto __pyx_L0;
19087 
19088  /* "View.MemoryView":1134
19089  * break
19090  *
19091  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
19092  * return 'C'
19093  * else:
19094  */
19095  }
19096 
19097  /* "View.MemoryView":1137
19098  * return 'C'
19099  * else:
19100  * return 'F' # <<<<<<<<<<<<<<
19101  *
19102  * @cython.cdivision(True)
19103  */
19104  /*else*/ {
19105  __pyx_r = 'F';
19106  goto __pyx_L0;
19107  }
19108 
19109  /* "View.MemoryView":1116
19110  *
19111  * @cname('__pyx_get_best_slice_order')
19112  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
19113  * """
19114  * Figure out the best memory access order for a given slice.
19115  */
19116 
19117  /* function exit code */
19118  __pyx_L0:;
19119  return __pyx_r;
19120 }
19121 
19122 /* "View.MemoryView":1140
19123  *
19124  * @cython.cdivision(True)
19125  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19126  * char *dst_data, Py_ssize_t *dst_strides,
19127  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19128  */
19129 
19130 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19131  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19132  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
19133  Py_ssize_t __pyx_v_dst_extent;
19134  Py_ssize_t __pyx_v_src_stride;
19135  Py_ssize_t __pyx_v_dst_stride;
19136  int __pyx_t_1;
19137  int __pyx_t_2;
19138  int __pyx_t_3;
19139  Py_ssize_t __pyx_t_4;
19140  Py_ssize_t __pyx_t_5;
19141  Py_ssize_t __pyx_t_6;
19142 
19143  /* "View.MemoryView":1147
19144  *
19145  * cdef Py_ssize_t i
19146  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
19147  * cdef Py_ssize_t dst_extent = dst_shape[0]
19148  * cdef Py_ssize_t src_stride = src_strides[0]
19149  */
19150  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
19151 
19152  /* "View.MemoryView":1148
19153  * cdef Py_ssize_t i
19154  * cdef Py_ssize_t src_extent = src_shape[0]
19155  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
19156  * cdef Py_ssize_t src_stride = src_strides[0]
19157  * cdef Py_ssize_t dst_stride = dst_strides[0]
19158  */
19159  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
19160 
19161  /* "View.MemoryView":1149
19162  * cdef Py_ssize_t src_extent = src_shape[0]
19163  * cdef Py_ssize_t dst_extent = dst_shape[0]
19164  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
19165  * cdef Py_ssize_t dst_stride = dst_strides[0]
19166  *
19167  */
19168  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
19169 
19170  /* "View.MemoryView":1150
19171  * cdef Py_ssize_t dst_extent = dst_shape[0]
19172  * cdef Py_ssize_t src_stride = src_strides[0]
19173  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
19174  *
19175  * if ndim == 1:
19176  */
19177  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
19178 
19179  /* "View.MemoryView":1152
19180  * cdef Py_ssize_t dst_stride = dst_strides[0]
19181  *
19182  * if ndim == 1: # <<<<<<<<<<<<<<
19183  * if (src_stride > 0 and dst_stride > 0 and
19184  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19185  */
19186  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19187  if (__pyx_t_1) {
19188 
19189  /* "View.MemoryView":1153
19190  *
19191  * if ndim == 1:
19192  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19193  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19194  * memcpy(dst_data, src_data, itemsize * dst_extent)
19195  */
19196  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
19197  if (__pyx_t_2) {
19198  } else {
19199  __pyx_t_1 = __pyx_t_2;
19200  goto __pyx_L5_bool_binop_done;
19201  }
19202  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
19203  if (__pyx_t_2) {
19204  } else {
19205  __pyx_t_1 = __pyx_t_2;
19206  goto __pyx_L5_bool_binop_done;
19207  }
19208 
19209  /* "View.MemoryView":1154
19210  * if ndim == 1:
19211  * if (src_stride > 0 and dst_stride > 0 and
19212  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
19213  * memcpy(dst_data, src_data, itemsize * dst_extent)
19214  * else:
19215  */
19216  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19217  if (__pyx_t_2) {
19218  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19219  }
19220  __pyx_t_3 = (__pyx_t_2 != 0);
19221  __pyx_t_1 = __pyx_t_3;
19222  __pyx_L5_bool_binop_done:;
19223 
19224  /* "View.MemoryView":1153
19225  *
19226  * if ndim == 1:
19227  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19228  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19229  * memcpy(dst_data, src_data, itemsize * dst_extent)
19230  */
19231  if (__pyx_t_1) {
19232 
19233  /* "View.MemoryView":1155
19234  * if (src_stride > 0 and dst_stride > 0 and
19235  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19236  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
19237  * else:
19238  * for i in range(dst_extent):
19239  */
19240  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19241 
19242  /* "View.MemoryView":1153
19243  *
19244  * if ndim == 1:
19245  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19246  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19247  * memcpy(dst_data, src_data, itemsize * dst_extent)
19248  */
19249  goto __pyx_L4;
19250  }
19251 
19252  /* "View.MemoryView":1157
19253  * memcpy(dst_data, src_data, itemsize * dst_extent)
19254  * else:
19255  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19256  * memcpy(dst_data, src_data, itemsize)
19257  * src_data += src_stride
19258  */
19259  /*else*/ {
19260  __pyx_t_4 = __pyx_v_dst_extent;
19261  __pyx_t_5 = __pyx_t_4;
19262  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19263  __pyx_v_i = __pyx_t_6;
19264 
19265  /* "View.MemoryView":1158
19266  * else:
19267  * for i in range(dst_extent):
19268  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
19269  * src_data += src_stride
19270  * dst_data += dst_stride
19271  */
19272  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19273 
19274  /* "View.MemoryView":1159
19275  * for i in range(dst_extent):
19276  * memcpy(dst_data, src_data, itemsize)
19277  * src_data += src_stride # <<<<<<<<<<<<<<
19278  * dst_data += dst_stride
19279  * else:
19280  */
19281  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19282 
19283  /* "View.MemoryView":1160
19284  * memcpy(dst_data, src_data, itemsize)
19285  * src_data += src_stride
19286  * dst_data += dst_stride # <<<<<<<<<<<<<<
19287  * else:
19288  * for i in range(dst_extent):
19289  */
19290  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19291  }
19292  }
19293  __pyx_L4:;
19294 
19295  /* "View.MemoryView":1152
19296  * cdef Py_ssize_t dst_stride = dst_strides[0]
19297  *
19298  * if ndim == 1: # <<<<<<<<<<<<<<
19299  * if (src_stride > 0 and dst_stride > 0 and
19300  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19301  */
19302  goto __pyx_L3;
19303  }
19304 
19305  /* "View.MemoryView":1162
19306  * dst_data += dst_stride
19307  * else:
19308  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19309  * _copy_strided_to_strided(src_data, src_strides + 1,
19310  * dst_data, dst_strides + 1,
19311  */
19312  /*else*/ {
19313  __pyx_t_4 = __pyx_v_dst_extent;
19314  __pyx_t_5 = __pyx_t_4;
19315  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19316  __pyx_v_i = __pyx_t_6;
19317 
19318  /* "View.MemoryView":1163
19319  * else:
19320  * for i in range(dst_extent):
19321  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
19322  * dst_data, dst_strides + 1,
19323  * src_shape + 1, dst_shape + 1,
19324  */
19325  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19326 
19327  /* "View.MemoryView":1167
19328  * src_shape + 1, dst_shape + 1,
19329  * ndim - 1, itemsize)
19330  * src_data += src_stride # <<<<<<<<<<<<<<
19331  * dst_data += dst_stride
19332  *
19333  */
19334  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19335 
19336  /* "View.MemoryView":1168
19337  * ndim - 1, itemsize)
19338  * src_data += src_stride
19339  * dst_data += dst_stride # <<<<<<<<<<<<<<
19340  *
19341  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
19342  */
19343  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19344  }
19345  }
19346  __pyx_L3:;
19347 
19348  /* "View.MemoryView":1140
19349  *
19350  * @cython.cdivision(True)
19351  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19352  * char *dst_data, Py_ssize_t *dst_strides,
19353  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19354  */
19355 
19356  /* function exit code */
19357 }
19358 
19359 /* "View.MemoryView":1170
19360  * dst_data += dst_stride
19361  *
19362  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19363  * __Pyx_memviewslice *dst,
19364  * int ndim, size_t itemsize) nogil:
19365  */
19366 
19367 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19368 
19369  /* "View.MemoryView":1173
19370  * __Pyx_memviewslice *dst,
19371  * int ndim, size_t itemsize) nogil:
19372  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
19373  * src.shape, dst.shape, ndim, itemsize)
19374  *
19375  */
19376  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19377 
19378  /* "View.MemoryView":1170
19379  * dst_data += dst_stride
19380  *
19381  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19382  * __Pyx_memviewslice *dst,
19383  * int ndim, size_t itemsize) nogil:
19384  */
19385 
19386  /* function exit code */
19387 }
19388 
19389 /* "View.MemoryView":1177
19390  *
19391  * @cname('__pyx_memoryview_slice_get_size')
19392  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19393  * "Return the size of the memory occupied by the slice in number of bytes"
19394  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19395  */
19396 
19397 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
19398  Py_ssize_t __pyx_v_shape;
19399  Py_ssize_t __pyx_v_size;
19400  Py_ssize_t __pyx_r;
19401  Py_ssize_t __pyx_t_1;
19402  Py_ssize_t *__pyx_t_2;
19403  Py_ssize_t *__pyx_t_3;
19404  Py_ssize_t *__pyx_t_4;
19405 
19406  /* "View.MemoryView":1179
19407  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
19408  * "Return the size of the memory occupied by the slice in number of bytes"
19409  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
19410  *
19411  * for shape in src.shape[:ndim]:
19412  */
19413  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19414  __pyx_v_size = __pyx_t_1;
19415 
19416  /* "View.MemoryView":1181
19417  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19418  *
19419  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
19420  * size *= shape
19421  *
19422  */
19423  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
19424  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
19425  __pyx_t_2 = __pyx_t_4;
19426  __pyx_v_shape = (__pyx_t_2[0]);
19427 
19428  /* "View.MemoryView":1182
19429  *
19430  * for shape in src.shape[:ndim]:
19431  * size *= shape # <<<<<<<<<<<<<<
19432  *
19433  * return size
19434  */
19435  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
19436  }
19437 
19438  /* "View.MemoryView":1184
19439  * size *= shape
19440  *
19441  * return size # <<<<<<<<<<<<<<
19442  *
19443  * @cname('__pyx_fill_contig_strides_array')
19444  */
19445  __pyx_r = __pyx_v_size;
19446  goto __pyx_L0;
19447 
19448  /* "View.MemoryView":1177
19449  *
19450  * @cname('__pyx_memoryview_slice_get_size')
19451  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19452  * "Return the size of the memory occupied by the slice in number of bytes"
19453  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19454  */
19455 
19456  /* function exit code */
19457  __pyx_L0:;
19458  return __pyx_r;
19459 }
19460 
19461 /* "View.MemoryView":1187
19462  *
19463  * @cname('__pyx_fill_contig_strides_array')
19464  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19465  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19466  * int ndim, char order) nogil:
19467  */
19468 
19469 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
19470  int __pyx_v_idx;
19471  Py_ssize_t __pyx_r;
19472  int __pyx_t_1;
19473  int __pyx_t_2;
19474  int __pyx_t_3;
19475  int __pyx_t_4;
19476 
19477  /* "View.MemoryView":1196
19478  * cdef int idx
19479  *
19480  * if order == 'F': # <<<<<<<<<<<<<<
19481  * for idx in range(ndim):
19482  * strides[idx] = stride
19483  */
19484  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19485  if (__pyx_t_1) {
19486 
19487  /* "View.MemoryView":1197
19488  *
19489  * if order == 'F':
19490  * for idx in range(ndim): # <<<<<<<<<<<<<<
19491  * strides[idx] = stride
19492  * stride *= shape[idx]
19493  */
19494  __pyx_t_2 = __pyx_v_ndim;
19495  __pyx_t_3 = __pyx_t_2;
19496  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19497  __pyx_v_idx = __pyx_t_4;
19498 
19499  /* "View.MemoryView":1198
19500  * if order == 'F':
19501  * for idx in range(ndim):
19502  * strides[idx] = stride # <<<<<<<<<<<<<<
19503  * stride *= shape[idx]
19504  * else:
19505  */
19506  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19507 
19508  /* "View.MemoryView":1199
19509  * for idx in range(ndim):
19510  * strides[idx] = stride
19511  * stride *= shape[idx] # <<<<<<<<<<<<<<
19512  * else:
19513  * for idx in range(ndim - 1, -1, -1):
19514  */
19515  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19516  }
19517 
19518  /* "View.MemoryView":1196
19519  * cdef int idx
19520  *
19521  * if order == 'F': # <<<<<<<<<<<<<<
19522  * for idx in range(ndim):
19523  * strides[idx] = stride
19524  */
19525  goto __pyx_L3;
19526  }
19527 
19528  /* "View.MemoryView":1201
19529  * stride *= shape[idx]
19530  * else:
19531  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19532  * strides[idx] = stride
19533  * stride *= shape[idx]
19534  */
19535  /*else*/ {
19536  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19537  __pyx_v_idx = __pyx_t_2;
19538 
19539  /* "View.MemoryView":1202
19540  * else:
19541  * for idx in range(ndim - 1, -1, -1):
19542  * strides[idx] = stride # <<<<<<<<<<<<<<
19543  * stride *= shape[idx]
19544  *
19545  */
19546  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19547 
19548  /* "View.MemoryView":1203
19549  * for idx in range(ndim - 1, -1, -1):
19550  * strides[idx] = stride
19551  * stride *= shape[idx] # <<<<<<<<<<<<<<
19552  *
19553  * return stride
19554  */
19555  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19556  }
19557  }
19558  __pyx_L3:;
19559 
19560  /* "View.MemoryView":1205
19561  * stride *= shape[idx]
19562  *
19563  * return stride # <<<<<<<<<<<<<<
19564  *
19565  * @cname('__pyx_memoryview_copy_data_to_temp')
19566  */
19567  __pyx_r = __pyx_v_stride;
19568  goto __pyx_L0;
19569 
19570  /* "View.MemoryView":1187
19571  *
19572  * @cname('__pyx_fill_contig_strides_array')
19573  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19574  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19575  * int ndim, char order) nogil:
19576  */
19577 
19578  /* function exit code */
19579  __pyx_L0:;
19580  return __pyx_r;
19581 }
19582 
19583 /* "View.MemoryView":1208
19584  *
19585  * @cname('__pyx_memoryview_copy_data_to_temp')
19586  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19587  * __Pyx_memviewslice *tmpslice,
19588  * char order,
19589  */
19590 
19591 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
19592  int __pyx_v_i;
19593  void *__pyx_v_result;
19594  size_t __pyx_v_itemsize;
19595  size_t __pyx_v_size;
19596  void *__pyx_r;
19597  Py_ssize_t __pyx_t_1;
19598  int __pyx_t_2;
19599  int __pyx_t_3;
19600  struct __pyx_memoryview_obj *__pyx_t_4;
19601  int __pyx_t_5;
19602  int __pyx_t_6;
19603  int __pyx_lineno = 0;
19604  const char *__pyx_filename = NULL;
19605  int __pyx_clineno = 0;
19606 
19607  /* "View.MemoryView":1219
19608  * cdef void *result
19609  *
19610  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19611  * cdef size_t size = slice_get_size(src, ndim)
19612  *
19613  */
19614  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19615  __pyx_v_itemsize = __pyx_t_1;
19616 
19617  /* "View.MemoryView":1220
19618  *
19619  * cdef size_t itemsize = src.memview.view.itemsize
19620  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19621  *
19622  * result = malloc(size)
19623  */
19624  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19625 
19626  /* "View.MemoryView":1222
19627  * cdef size_t size = slice_get_size(src, ndim)
19628  *
19629  * result = malloc(size) # <<<<<<<<<<<<<<
19630  * if not result:
19631  * _err(MemoryError, NULL)
19632  */
19633  __pyx_v_result = malloc(__pyx_v_size);
19634 
19635  /* "View.MemoryView":1223
19636  *
19637  * result = malloc(size)
19638  * if not result: # <<<<<<<<<<<<<<
19639  * _err(MemoryError, NULL)
19640  *
19641  */
19642  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19643  if (__pyx_t_2) {
19644 
19645  /* "View.MemoryView":1224
19646  * result = malloc(size)
19647  * if not result:
19648  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19649  *
19650  *
19651  */
19652  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
19653 
19654  /* "View.MemoryView":1223
19655  *
19656  * result = malloc(size)
19657  * if not result: # <<<<<<<<<<<<<<
19658  * _err(MemoryError, NULL)
19659  *
19660  */
19661  }
19662 
19663  /* "View.MemoryView":1227
19664  *
19665  *
19666  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19667  * tmpslice.memview = src.memview
19668  * for i in range(ndim):
19669  */
19670  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19671 
19672  /* "View.MemoryView":1228
19673  *
19674  * tmpslice.data = <char *> result
19675  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19676  * for i in range(ndim):
19677  * tmpslice.shape[i] = src.shape[i]
19678  */
19679  __pyx_t_4 = __pyx_v_src->memview;
19680  __pyx_v_tmpslice->memview = __pyx_t_4;
19681 
19682  /* "View.MemoryView":1229
19683  * tmpslice.data = <char *> result
19684  * tmpslice.memview = src.memview
19685  * for i in range(ndim): # <<<<<<<<<<<<<<
19686  * tmpslice.shape[i] = src.shape[i]
19687  * tmpslice.suboffsets[i] = -1
19688  */
19689  __pyx_t_3 = __pyx_v_ndim;
19690  __pyx_t_5 = __pyx_t_3;
19691  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19692  __pyx_v_i = __pyx_t_6;
19693 
19694  /* "View.MemoryView":1230
19695  * tmpslice.memview = src.memview
19696  * for i in range(ndim):
19697  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19698  * tmpslice.suboffsets[i] = -1
19699  *
19700  */
19701  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19702 
19703  /* "View.MemoryView":1231
19704  * for i in range(ndim):
19705  * tmpslice.shape[i] = src.shape[i]
19706  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19707  *
19708  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19709  */
19710  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19711  }
19712 
19713  /* "View.MemoryView":1233
19714  * tmpslice.suboffsets[i] = -1
19715  *
19716  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19717  * ndim, order)
19718  *
19719  */
19720  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19721 
19722  /* "View.MemoryView":1237
19723  *
19724  *
19725  * for i in range(ndim): # <<<<<<<<<<<<<<
19726  * if tmpslice.shape[i] == 1:
19727  * tmpslice.strides[i] = 0
19728  */
19729  __pyx_t_3 = __pyx_v_ndim;
19730  __pyx_t_5 = __pyx_t_3;
19731  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19732  __pyx_v_i = __pyx_t_6;
19733 
19734  /* "View.MemoryView":1238
19735  *
19736  * for i in range(ndim):
19737  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19738  * tmpslice.strides[i] = 0
19739  *
19740  */
19741  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19742  if (__pyx_t_2) {
19743 
19744  /* "View.MemoryView":1239
19745  * for i in range(ndim):
19746  * if tmpslice.shape[i] == 1:
19747  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19748  *
19749  * if slice_is_contig(src[0], order, ndim):
19750  */
19751  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19752 
19753  /* "View.MemoryView":1238
19754  *
19755  * for i in range(ndim):
19756  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19757  * tmpslice.strides[i] = 0
19758  *
19759  */
19760  }
19761  }
19762 
19763  /* "View.MemoryView":1241
19764  * tmpslice.strides[i] = 0
19765  *
19766  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19767  * memcpy(result, src.data, size)
19768  * else:
19769  */
19770  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19771  if (__pyx_t_2) {
19772 
19773  /* "View.MemoryView":1242
19774  *
19775  * if slice_is_contig(src[0], order, ndim):
19776  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19777  * else:
19778  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19779  */
19780  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19781 
19782  /* "View.MemoryView":1241
19783  * tmpslice.strides[i] = 0
19784  *
19785  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19786  * memcpy(result, src.data, size)
19787  * else:
19788  */
19789  goto __pyx_L9;
19790  }
19791 
19792  /* "View.MemoryView":1244
19793  * memcpy(result, src.data, size)
19794  * else:
19795  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19796  *
19797  * return result
19798  */
19799  /*else*/ {
19800  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19801  }
19802  __pyx_L9:;
19803 
19804  /* "View.MemoryView":1246
19805  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19806  *
19807  * return result # <<<<<<<<<<<<<<
19808  *
19809  *
19810  */
19811  __pyx_r = __pyx_v_result;
19812  goto __pyx_L0;
19813 
19814  /* "View.MemoryView":1208
19815  *
19816  * @cname('__pyx_memoryview_copy_data_to_temp')
19817  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19818  * __Pyx_memviewslice *tmpslice,
19819  * char order,
19820  */
19821 
19822  /* function exit code */
19823  __pyx_L1_error:;
19824  {
19825  #ifdef WITH_THREAD
19826  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19827  #endif
19828  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19829  #ifdef WITH_THREAD
19830  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19831  #endif
19832  }
19833  __pyx_r = NULL;
19834  __pyx_L0:;
19835  return __pyx_r;
19836 }
19837 
19838 /* "View.MemoryView":1251
19839  *
19840  * @cname('__pyx_memoryview_err_extents')
19841  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19842  * Py_ssize_t extent2) except -1 with gil:
19843  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19844  */
19845 
19846 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19847  int __pyx_r;
19848  __Pyx_RefNannyDeclarations
19849  PyObject *__pyx_t_1 = NULL;
19850  PyObject *__pyx_t_2 = NULL;
19851  PyObject *__pyx_t_3 = NULL;
19852  PyObject *__pyx_t_4 = NULL;
19853  int __pyx_lineno = 0;
19854  const char *__pyx_filename = NULL;
19855  int __pyx_clineno = 0;
19856  #ifdef WITH_THREAD
19857  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19858  #endif
19859  __Pyx_RefNannySetupContext("_err_extents", 0);
19860 
19861  /* "View.MemoryView":1254
19862  * Py_ssize_t extent2) except -1 with gil:
19863  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19864  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19865  *
19866  * @cname('__pyx_memoryview_err_dim')
19867  */
19868  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19869  __Pyx_GOTREF(__pyx_t_1);
19870  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19871  __Pyx_GOTREF(__pyx_t_2);
19872  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19873  __Pyx_GOTREF(__pyx_t_3);
19874  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19875  __Pyx_GOTREF(__pyx_t_4);
19876  __Pyx_GIVEREF(__pyx_t_1);
19877  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19878  __Pyx_GIVEREF(__pyx_t_2);
19879  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19880  __Pyx_GIVEREF(__pyx_t_3);
19881  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19882  __pyx_t_1 = 0;
19883  __pyx_t_2 = 0;
19884  __pyx_t_3 = 0;
19885 
19886  /* "View.MemoryView":1253
19887  * cdef int _err_extents(int i, Py_ssize_t extent1,
19888  * Py_ssize_t extent2) except -1 with gil:
19889  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19890  * (i, extent1, extent2))
19891  *
19892  */
19893  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
19894  __Pyx_GOTREF(__pyx_t_3);
19895  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19896  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
19897  __Pyx_GOTREF(__pyx_t_4);
19898  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19899  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19900  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19901  __PYX_ERR(1, 1253, __pyx_L1_error)
19902 
19903  /* "View.MemoryView":1251
19904  *
19905  * @cname('__pyx_memoryview_err_extents')
19906  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19907  * Py_ssize_t extent2) except -1 with gil:
19908  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19909  */
19910 
19911  /* function exit code */
19912  __pyx_L1_error:;
19913  __Pyx_XDECREF(__pyx_t_1);
19914  __Pyx_XDECREF(__pyx_t_2);
19915  __Pyx_XDECREF(__pyx_t_3);
19916  __Pyx_XDECREF(__pyx_t_4);
19917  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19918  __pyx_r = -1;
19919  __Pyx_RefNannyFinishContext();
19920  #ifdef WITH_THREAD
19921  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19922  #endif
19923  return __pyx_r;
19924 }
19925 
19926 /* "View.MemoryView":1257
19927  *
19928  * @cname('__pyx_memoryview_err_dim')
19929  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19930  * raise error(msg.decode('ascii') % dim)
19931  *
19932  */
19933 
19934 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19935  int __pyx_r;
19936  __Pyx_RefNannyDeclarations
19937  PyObject *__pyx_t_1 = NULL;
19938  PyObject *__pyx_t_2 = NULL;
19939  PyObject *__pyx_t_3 = NULL;
19940  PyObject *__pyx_t_4 = NULL;
19941  int __pyx_lineno = 0;
19942  const char *__pyx_filename = NULL;
19943  int __pyx_clineno = 0;
19944  #ifdef WITH_THREAD
19945  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19946  #endif
19947  __Pyx_RefNannySetupContext("_err_dim", 0);
19948  __Pyx_INCREF(__pyx_v_error);
19949 
19950  /* "View.MemoryView":1258
19951  * @cname('__pyx_memoryview_err_dim')
19952  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19953  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19954  *
19955  * @cname('__pyx_memoryview_err')
19956  */
19957  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19958  __Pyx_GOTREF(__pyx_t_2);
19959  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19960  __Pyx_GOTREF(__pyx_t_3);
19961  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19962  __Pyx_GOTREF(__pyx_t_4);
19963  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19964  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19965  __Pyx_INCREF(__pyx_v_error);
19966  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19967  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19968  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19969  if (likely(__pyx_t_2)) {
19970  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19971  __Pyx_INCREF(__pyx_t_2);
19972  __Pyx_INCREF(function);
19973  __Pyx_DECREF_SET(__pyx_t_3, function);
19974  }
19975  }
19976  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19977  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19978  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19979  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19980  __Pyx_GOTREF(__pyx_t_1);
19981  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19982  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19983  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19984  __PYX_ERR(1, 1258, __pyx_L1_error)
19985 
19986  /* "View.MemoryView":1257
19987  *
19988  * @cname('__pyx_memoryview_err_dim')
19989  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19990  * raise error(msg.decode('ascii') % dim)
19991  *
19992  */
19993 
19994  /* function exit code */
19995  __pyx_L1_error:;
19996  __Pyx_XDECREF(__pyx_t_1);
19997  __Pyx_XDECREF(__pyx_t_2);
19998  __Pyx_XDECREF(__pyx_t_3);
19999  __Pyx_XDECREF(__pyx_t_4);
20000  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
20001  __pyx_r = -1;
20002  __Pyx_XDECREF(__pyx_v_error);
20003  __Pyx_RefNannyFinishContext();
20004  #ifdef WITH_THREAD
20005  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20006  #endif
20007  return __pyx_r;
20008 }
20009 
20010 /* "View.MemoryView":1261
20011  *
20012  * @cname('__pyx_memoryview_err')
20013  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20014  * if msg != NULL:
20015  * raise error(msg.decode('ascii'))
20016  */
20017 
20018 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
20019  int __pyx_r;
20020  __Pyx_RefNannyDeclarations
20021  int __pyx_t_1;
20022  PyObject *__pyx_t_2 = NULL;
20023  PyObject *__pyx_t_3 = NULL;
20024  PyObject *__pyx_t_4 = NULL;
20025  PyObject *__pyx_t_5 = NULL;
20026  int __pyx_lineno = 0;
20027  const char *__pyx_filename = NULL;
20028  int __pyx_clineno = 0;
20029  #ifdef WITH_THREAD
20030  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20031  #endif
20032  __Pyx_RefNannySetupContext("_err", 0);
20033  __Pyx_INCREF(__pyx_v_error);
20034 
20035  /* "View.MemoryView":1262
20036  * @cname('__pyx_memoryview_err')
20037  * cdef int _err(object error, char *msg) except -1 with gil:
20038  * if msg != NULL: # <<<<<<<<<<<<<<
20039  * raise error(msg.decode('ascii'))
20040  * else:
20041  */
20042  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
20043  if (unlikely(__pyx_t_1)) {
20044 
20045  /* "View.MemoryView":1263
20046  * cdef int _err(object error, char *msg) except -1 with gil:
20047  * if msg != NULL:
20048  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
20049  * else:
20050  * raise error
20051  */
20052  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
20053  __Pyx_GOTREF(__pyx_t_3);
20054  __Pyx_INCREF(__pyx_v_error);
20055  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
20056  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20057  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20058  if (likely(__pyx_t_5)) {
20059  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20060  __Pyx_INCREF(__pyx_t_5);
20061  __Pyx_INCREF(function);
20062  __Pyx_DECREF_SET(__pyx_t_4, function);
20063  }
20064  }
20065  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
20066  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20067  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20068  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
20069  __Pyx_GOTREF(__pyx_t_2);
20070  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20071  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20072  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20073  __PYX_ERR(1, 1263, __pyx_L1_error)
20074 
20075  /* "View.MemoryView":1262
20076  * @cname('__pyx_memoryview_err')
20077  * cdef int _err(object error, char *msg) except -1 with gil:
20078  * if msg != NULL: # <<<<<<<<<<<<<<
20079  * raise error(msg.decode('ascii'))
20080  * else:
20081  */
20082  }
20083 
20084  /* "View.MemoryView":1265
20085  * raise error(msg.decode('ascii'))
20086  * else:
20087  * raise error # <<<<<<<<<<<<<<
20088  *
20089  * @cname('__pyx_memoryview_copy_contents')
20090  */
20091  /*else*/ {
20092  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
20093  __PYX_ERR(1, 1265, __pyx_L1_error)
20094  }
20095 
20096  /* "View.MemoryView":1261
20097  *
20098  * @cname('__pyx_memoryview_err')
20099  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20100  * if msg != NULL:
20101  * raise error(msg.decode('ascii'))
20102  */
20103 
20104  /* function exit code */
20105  __pyx_L1_error:;
20106  __Pyx_XDECREF(__pyx_t_2);
20107  __Pyx_XDECREF(__pyx_t_3);
20108  __Pyx_XDECREF(__pyx_t_4);
20109  __Pyx_XDECREF(__pyx_t_5);
20110  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
20111  __pyx_r = -1;
20112  __Pyx_XDECREF(__pyx_v_error);
20113  __Pyx_RefNannyFinishContext();
20114  #ifdef WITH_THREAD
20115  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20116  #endif
20117  return __pyx_r;
20118 }
20119 
20120 /* "View.MemoryView":1268
20121  *
20122  * @cname('__pyx_memoryview_copy_contents')
20123  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20124  * __Pyx_memviewslice dst,
20125  * int src_ndim, int dst_ndim,
20126  */
20127 
20128 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
20129  void *__pyx_v_tmpdata;
20130  size_t __pyx_v_itemsize;
20131  int __pyx_v_i;
20132  char __pyx_v_order;
20133  int __pyx_v_broadcasting;
20134  int __pyx_v_direct_copy;
20135  __Pyx_memviewslice __pyx_v_tmp;
20136  int __pyx_v_ndim;
20137  int __pyx_r;
20138  Py_ssize_t __pyx_t_1;
20139  int __pyx_t_2;
20140  int __pyx_t_3;
20141  int __pyx_t_4;
20142  int __pyx_t_5;
20143  int __pyx_t_6;
20144  void *__pyx_t_7;
20145  int __pyx_t_8;
20146  int __pyx_lineno = 0;
20147  const char *__pyx_filename = NULL;
20148  int __pyx_clineno = 0;
20149 
20150  /* "View.MemoryView":1276
20151  * Check for overlapping memory and verify the shapes.
20152  * """
20153  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
20154  * cdef size_t itemsize = src.memview.view.itemsize
20155  * cdef int i
20156  */
20157  __pyx_v_tmpdata = NULL;
20158 
20159  /* "View.MemoryView":1277
20160  * """
20161  * cdef void *tmpdata = NULL
20162  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
20163  * cdef int i
20164  * cdef char order = get_best_order(&src, src_ndim)
20165  */
20166  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
20167  __pyx_v_itemsize = __pyx_t_1;
20168 
20169  /* "View.MemoryView":1279
20170  * cdef size_t itemsize = src.memview.view.itemsize
20171  * cdef int i
20172  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
20173  * cdef bint broadcasting = False
20174  * cdef bint direct_copy = False
20175  */
20176  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
20177 
20178  /* "View.MemoryView":1280
20179  * cdef int i
20180  * cdef char order = get_best_order(&src, src_ndim)
20181  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
20182  * cdef bint direct_copy = False
20183  * cdef __Pyx_memviewslice tmp
20184  */
20185  __pyx_v_broadcasting = 0;
20186 
20187  /* "View.MemoryView":1281
20188  * cdef char order = get_best_order(&src, src_ndim)
20189  * cdef bint broadcasting = False
20190  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
20191  * cdef __Pyx_memviewslice tmp
20192  *
20193  */
20194  __pyx_v_direct_copy = 0;
20195 
20196  /* "View.MemoryView":1284
20197  * cdef __Pyx_memviewslice tmp
20198  *
20199  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20200  * broadcast_leading(&src, src_ndim, dst_ndim)
20201  * elif dst_ndim < src_ndim:
20202  */
20203  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20204  if (__pyx_t_2) {
20205 
20206  /* "View.MemoryView":1285
20207  *
20208  * if src_ndim < dst_ndim:
20209  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20210  * elif dst_ndim < src_ndim:
20211  * broadcast_leading(&dst, dst_ndim, src_ndim)
20212  */
20213  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20214 
20215  /* "View.MemoryView":1284
20216  * cdef __Pyx_memviewslice tmp
20217  *
20218  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20219  * broadcast_leading(&src, src_ndim, dst_ndim)
20220  * elif dst_ndim < src_ndim:
20221  */
20222  goto __pyx_L3;
20223  }
20224 
20225  /* "View.MemoryView":1286
20226  * if src_ndim < dst_ndim:
20227  * broadcast_leading(&src, src_ndim, dst_ndim)
20228  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20229  * broadcast_leading(&dst, dst_ndim, src_ndim)
20230  *
20231  */
20232  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20233  if (__pyx_t_2) {
20234 
20235  /* "View.MemoryView":1287
20236  * broadcast_leading(&src, src_ndim, dst_ndim)
20237  * elif dst_ndim < src_ndim:
20238  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
20239  *
20240  * cdef int ndim = max(src_ndim, dst_ndim)
20241  */
20242  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20243 
20244  /* "View.MemoryView":1286
20245  * if src_ndim < dst_ndim:
20246  * broadcast_leading(&src, src_ndim, dst_ndim)
20247  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20248  * broadcast_leading(&dst, dst_ndim, src_ndim)
20249  *
20250  */
20251  }
20252  __pyx_L3:;
20253 
20254  /* "View.MemoryView":1289
20255  * broadcast_leading(&dst, dst_ndim, src_ndim)
20256  *
20257  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20258  *
20259  * for i in range(ndim):
20260  */
20261  __pyx_t_3 = __pyx_v_dst_ndim;
20262  __pyx_t_4 = __pyx_v_src_ndim;
20263  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20264  __pyx_t_5 = __pyx_t_3;
20265  } else {
20266  __pyx_t_5 = __pyx_t_4;
20267  }
20268  __pyx_v_ndim = __pyx_t_5;
20269 
20270  /* "View.MemoryView":1291
20271  * cdef int ndim = max(src_ndim, dst_ndim)
20272  *
20273  * for i in range(ndim): # <<<<<<<<<<<<<<
20274  * if src.shape[i] != dst.shape[i]:
20275  * if src.shape[i] == 1:
20276  */
20277  __pyx_t_5 = __pyx_v_ndim;
20278  __pyx_t_3 = __pyx_t_5;
20279  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20280  __pyx_v_i = __pyx_t_4;
20281 
20282  /* "View.MemoryView":1292
20283  *
20284  * for i in range(ndim):
20285  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20286  * if src.shape[i] == 1:
20287  * broadcasting = True
20288  */
20289  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20290  if (__pyx_t_2) {
20291 
20292  /* "View.MemoryView":1293
20293  * for i in range(ndim):
20294  * if src.shape[i] != dst.shape[i]:
20295  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20296  * broadcasting = True
20297  * src.strides[i] = 0
20298  */
20299  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20300  if (__pyx_t_2) {
20301 
20302  /* "View.MemoryView":1294
20303  * if src.shape[i] != dst.shape[i]:
20304  * if src.shape[i] == 1:
20305  * broadcasting = True # <<<<<<<<<<<<<<
20306  * src.strides[i] = 0
20307  * else:
20308  */
20309  __pyx_v_broadcasting = 1;
20310 
20311  /* "View.MemoryView":1295
20312  * if src.shape[i] == 1:
20313  * broadcasting = True
20314  * src.strides[i] = 0 # <<<<<<<<<<<<<<
20315  * else:
20316  * _err_extents(i, dst.shape[i], src.shape[i])
20317  */
20318  (__pyx_v_src.strides[__pyx_v_i]) = 0;
20319 
20320  /* "View.MemoryView":1293
20321  * for i in range(ndim):
20322  * if src.shape[i] != dst.shape[i]:
20323  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20324  * broadcasting = True
20325  * src.strides[i] = 0
20326  */
20327  goto __pyx_L7;
20328  }
20329 
20330  /* "View.MemoryView":1297
20331  * src.strides[i] = 0
20332  * else:
20333  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
20334  *
20335  * if src.suboffsets[i] >= 0:
20336  */
20337  /*else*/ {
20338  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
20339  }
20340  __pyx_L7:;
20341 
20342  /* "View.MemoryView":1292
20343  *
20344  * for i in range(ndim):
20345  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20346  * if src.shape[i] == 1:
20347  * broadcasting = True
20348  */
20349  }
20350 
20351  /* "View.MemoryView":1299
20352  * _err_extents(i, dst.shape[i], src.shape[i])
20353  *
20354  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20355  * _err_dim(ValueError, "Dimension %d is not direct", i)
20356  *
20357  */
20358  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20359  if (__pyx_t_2) {
20360 
20361  /* "View.MemoryView":1300
20362  *
20363  * if src.suboffsets[i] >= 0:
20364  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
20365  *
20366  * if slices_overlap(&src, &dst, ndim, itemsize):
20367  */
20368  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
20369 
20370  /* "View.MemoryView":1299
20371  * _err_extents(i, dst.shape[i], src.shape[i])
20372  *
20373  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20374  * _err_dim(ValueError, "Dimension %d is not direct", i)
20375  *
20376  */
20377  }
20378  }
20379 
20380  /* "View.MemoryView":1302
20381  * _err_dim(ValueError, "Dimension %d is not direct", i)
20382  *
20383  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20384  *
20385  * if not slice_is_contig(src, order, ndim):
20386  */
20387  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20388  if (__pyx_t_2) {
20389 
20390  /* "View.MemoryView":1304
20391  * if slices_overlap(&src, &dst, ndim, itemsize):
20392  *
20393  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20394  * order = get_best_order(&dst, ndim)
20395  *
20396  */
20397  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20398  if (__pyx_t_2) {
20399 
20400  /* "View.MemoryView":1305
20401  *
20402  * if not slice_is_contig(src, order, ndim):
20403  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
20404  *
20405  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20406  */
20407  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20408 
20409  /* "View.MemoryView":1304
20410  * if slices_overlap(&src, &dst, ndim, itemsize):
20411  *
20412  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20413  * order = get_best_order(&dst, ndim)
20414  *
20415  */
20416  }
20417 
20418  /* "View.MemoryView":1307
20419  * order = get_best_order(&dst, ndim)
20420  *
20421  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
20422  * src = tmp
20423  *
20424  */
20425  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
20426  __pyx_v_tmpdata = __pyx_t_7;
20427 
20428  /* "View.MemoryView":1308
20429  *
20430  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20431  * src = tmp # <<<<<<<<<<<<<<
20432  *
20433  * if not broadcasting:
20434  */
20435  __pyx_v_src = __pyx_v_tmp;
20436 
20437  /* "View.MemoryView":1302
20438  * _err_dim(ValueError, "Dimension %d is not direct", i)
20439  *
20440  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20441  *
20442  * if not slice_is_contig(src, order, ndim):
20443  */
20444  }
20445 
20446  /* "View.MemoryView":1310
20447  * src = tmp
20448  *
20449  * if not broadcasting: # <<<<<<<<<<<<<<
20450  *
20451  *
20452  */
20453  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20454  if (__pyx_t_2) {
20455 
20456  /* "View.MemoryView":1313
20457  *
20458  *
20459  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20460  * direct_copy = slice_is_contig(dst, 'C', ndim)
20461  * elif slice_is_contig(src, 'F', ndim):
20462  */
20463  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
20464  if (__pyx_t_2) {
20465 
20466  /* "View.MemoryView":1314
20467  *
20468  * if slice_is_contig(src, 'C', ndim):
20469  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20470  * elif slice_is_contig(src, 'F', ndim):
20471  * direct_copy = slice_is_contig(dst, 'F', ndim)
20472  */
20473  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20474 
20475  /* "View.MemoryView":1313
20476  *
20477  *
20478  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20479  * direct_copy = slice_is_contig(dst, 'C', ndim)
20480  * elif slice_is_contig(src, 'F', ndim):
20481  */
20482  goto __pyx_L12;
20483  }
20484 
20485  /* "View.MemoryView":1315
20486  * if slice_is_contig(src, 'C', ndim):
20487  * direct_copy = slice_is_contig(dst, 'C', ndim)
20488  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20489  * direct_copy = slice_is_contig(dst, 'F', ndim)
20490  *
20491  */
20492  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20493  if (__pyx_t_2) {
20494 
20495  /* "View.MemoryView":1316
20496  * direct_copy = slice_is_contig(dst, 'C', ndim)
20497  * elif slice_is_contig(src, 'F', ndim):
20498  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20499  *
20500  * if direct_copy:
20501  */
20502  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20503 
20504  /* "View.MemoryView":1315
20505  * if slice_is_contig(src, 'C', ndim):
20506  * direct_copy = slice_is_contig(dst, 'C', ndim)
20507  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20508  * direct_copy = slice_is_contig(dst, 'F', ndim)
20509  *
20510  */
20511  }
20512  __pyx_L12:;
20513 
20514  /* "View.MemoryView":1318
20515  * direct_copy = slice_is_contig(dst, 'F', ndim)
20516  *
20517  * if direct_copy: # <<<<<<<<<<<<<<
20518  *
20519  * refcount_copying(&dst, dtype_is_object, ndim, False)
20520  */
20521  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20522  if (__pyx_t_2) {
20523 
20524  /* "View.MemoryView":1320
20525  * if direct_copy:
20526  *
20527  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20528  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20529  * refcount_copying(&dst, dtype_is_object, ndim, True)
20530  */
20531  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20532 
20533  /* "View.MemoryView":1321
20534  *
20535  * refcount_copying(&dst, dtype_is_object, ndim, False)
20536  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20537  * refcount_copying(&dst, dtype_is_object, ndim, True)
20538  * free(tmpdata)
20539  */
20540  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20541 
20542  /* "View.MemoryView":1322
20543  * refcount_copying(&dst, dtype_is_object, ndim, False)
20544  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20545  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20546  * free(tmpdata)
20547  * return 0
20548  */
20549  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20550 
20551  /* "View.MemoryView":1323
20552  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20553  * refcount_copying(&dst, dtype_is_object, ndim, True)
20554  * free(tmpdata) # <<<<<<<<<<<<<<
20555  * return 0
20556  *
20557  */
20558  free(__pyx_v_tmpdata);
20559 
20560  /* "View.MemoryView":1324
20561  * refcount_copying(&dst, dtype_is_object, ndim, True)
20562  * free(tmpdata)
20563  * return 0 # <<<<<<<<<<<<<<
20564  *
20565  * if order == 'F' == get_best_order(&dst, ndim):
20566  */
20567  __pyx_r = 0;
20568  goto __pyx_L0;
20569 
20570  /* "View.MemoryView":1318
20571  * direct_copy = slice_is_contig(dst, 'F', ndim)
20572  *
20573  * if direct_copy: # <<<<<<<<<<<<<<
20574  *
20575  * refcount_copying(&dst, dtype_is_object, ndim, False)
20576  */
20577  }
20578 
20579  /* "View.MemoryView":1310
20580  * src = tmp
20581  *
20582  * if not broadcasting: # <<<<<<<<<<<<<<
20583  *
20584  *
20585  */
20586  }
20587 
20588  /* "View.MemoryView":1326
20589  * return 0
20590  *
20591  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20592  *
20593  *
20594  */
20595  __pyx_t_2 = (__pyx_v_order == 'F');
20596  if (__pyx_t_2) {
20597  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20598  }
20599  __pyx_t_8 = (__pyx_t_2 != 0);
20600  if (__pyx_t_8) {
20601 
20602  /* "View.MemoryView":1329
20603  *
20604  *
20605  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20606  * transpose_memslice(&dst)
20607  *
20608  */
20609  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
20610 
20611  /* "View.MemoryView":1330
20612  *
20613  * transpose_memslice(&src)
20614  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20615  *
20616  * refcount_copying(&dst, dtype_is_object, ndim, False)
20617  */
20618  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
20619 
20620  /* "View.MemoryView":1326
20621  * return 0
20622  *
20623  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20624  *
20625  *
20626  */
20627  }
20628 
20629  /* "View.MemoryView":1332
20630  * transpose_memslice(&dst)
20631  *
20632  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20633  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20634  * refcount_copying(&dst, dtype_is_object, ndim, True)
20635  */
20636  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20637 
20638  /* "View.MemoryView":1333
20639  *
20640  * refcount_copying(&dst, dtype_is_object, ndim, False)
20641  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20642  * refcount_copying(&dst, dtype_is_object, ndim, True)
20643  *
20644  */
20645  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20646 
20647  /* "View.MemoryView":1334
20648  * refcount_copying(&dst, dtype_is_object, ndim, False)
20649  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20650  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20651  *
20652  * free(tmpdata)
20653  */
20654  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20655 
20656  /* "View.MemoryView":1336
20657  * refcount_copying(&dst, dtype_is_object, ndim, True)
20658  *
20659  * free(tmpdata) # <<<<<<<<<<<<<<
20660  * return 0
20661  *
20662  */
20663  free(__pyx_v_tmpdata);
20664 
20665  /* "View.MemoryView":1337
20666  *
20667  * free(tmpdata)
20668  * return 0 # <<<<<<<<<<<<<<
20669  *
20670  * @cname('__pyx_memoryview_broadcast_leading')
20671  */
20672  __pyx_r = 0;
20673  goto __pyx_L0;
20674 
20675  /* "View.MemoryView":1268
20676  *
20677  * @cname('__pyx_memoryview_copy_contents')
20678  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20679  * __Pyx_memviewslice dst,
20680  * int src_ndim, int dst_ndim,
20681  */
20682 
20683  /* function exit code */
20684  __pyx_L1_error:;
20685  {
20686  #ifdef WITH_THREAD
20687  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20688  #endif
20689  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20690  #ifdef WITH_THREAD
20691  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20692  #endif
20693  }
20694  __pyx_r = -1;
20695  __pyx_L0:;
20696  return __pyx_r;
20697 }
20698 
20699 /* "View.MemoryView":1340
20700  *
20701  * @cname('__pyx_memoryview_broadcast_leading')
20702  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20703  * int ndim,
20704  * int ndim_other) nogil:
20705  */
20706 
20707 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20708  int __pyx_v_i;
20709  int __pyx_v_offset;
20710  int __pyx_t_1;
20711  int __pyx_t_2;
20712  int __pyx_t_3;
20713 
20714  /* "View.MemoryView":1344
20715  * int ndim_other) nogil:
20716  * cdef int i
20717  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20718  *
20719  * for i in range(ndim - 1, -1, -1):
20720  */
20721  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20722 
20723  /* "View.MemoryView":1346
20724  * cdef int offset = ndim_other - ndim
20725  *
20726  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20727  * mslice.shape[i + offset] = mslice.shape[i]
20728  * mslice.strides[i + offset] = mslice.strides[i]
20729  */
20730  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20731  __pyx_v_i = __pyx_t_1;
20732 
20733  /* "View.MemoryView":1347
20734  *
20735  * for i in range(ndim - 1, -1, -1):
20736  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20737  * mslice.strides[i + offset] = mslice.strides[i]
20738  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20739  */
20740  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20741 
20742  /* "View.MemoryView":1348
20743  * for i in range(ndim - 1, -1, -1):
20744  * mslice.shape[i + offset] = mslice.shape[i]
20745  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20746  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20747  *
20748  */
20749  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20750 
20751  /* "View.MemoryView":1349
20752  * mslice.shape[i + offset] = mslice.shape[i]
20753  * mslice.strides[i + offset] = mslice.strides[i]
20754  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20755  *
20756  * for i in range(offset):
20757  */
20758  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20759  }
20760 
20761  /* "View.MemoryView":1351
20762  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20763  *
20764  * for i in range(offset): # <<<<<<<<<<<<<<
20765  * mslice.shape[i] = 1
20766  * mslice.strides[i] = mslice.strides[0]
20767  */
20768  __pyx_t_1 = __pyx_v_offset;
20769  __pyx_t_2 = __pyx_t_1;
20770  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20771  __pyx_v_i = __pyx_t_3;
20772 
20773  /* "View.MemoryView":1352
20774  *
20775  * for i in range(offset):
20776  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20777  * mslice.strides[i] = mslice.strides[0]
20778  * mslice.suboffsets[i] = -1
20779  */
20780  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20781 
20782  /* "View.MemoryView":1353
20783  * for i in range(offset):
20784  * mslice.shape[i] = 1
20785  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20786  * mslice.suboffsets[i] = -1
20787  *
20788  */
20789  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20790 
20791  /* "View.MemoryView":1354
20792  * mslice.shape[i] = 1
20793  * mslice.strides[i] = mslice.strides[0]
20794  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20795  *
20796  *
20797  */
20798  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20799  }
20800 
20801  /* "View.MemoryView":1340
20802  *
20803  * @cname('__pyx_memoryview_broadcast_leading')
20804  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20805  * int ndim,
20806  * int ndim_other) nogil:
20807  */
20808 
20809  /* function exit code */
20810 }
20811 
20812 /* "View.MemoryView":1362
20813  *
20814  * @cname('__pyx_memoryview_refcount_copying')
20815  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20816  * int ndim, bint inc) nogil:
20817  *
20818  */
20819 
20820 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
20821  int __pyx_t_1;
20822 
20823  /* "View.MemoryView":1366
20824  *
20825  *
20826  * if dtype_is_object: # <<<<<<<<<<<<<<
20827  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20828  * dst.strides, ndim, inc)
20829  */
20830  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20831  if (__pyx_t_1) {
20832 
20833  /* "View.MemoryView":1367
20834  *
20835  * if dtype_is_object:
20836  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20837  * dst.strides, ndim, inc)
20838  *
20839  */
20840  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20841 
20842  /* "View.MemoryView":1366
20843  *
20844  *
20845  * if dtype_is_object: # <<<<<<<<<<<<<<
20846  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20847  * dst.strides, ndim, inc)
20848  */
20849  }
20850 
20851  /* "View.MemoryView":1362
20852  *
20853  * @cname('__pyx_memoryview_refcount_copying')
20854  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20855  * int ndim, bint inc) nogil:
20856  *
20857  */
20858 
20859  /* function exit code */
20860 }
20861 
20862 /* "View.MemoryView":1371
20863  *
20864  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20865  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20866  * Py_ssize_t *strides, int ndim,
20867  * bint inc) with gil:
20868  */
20869 
20870 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20871  __Pyx_RefNannyDeclarations
20872  #ifdef WITH_THREAD
20873  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20874  #endif
20875  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20876 
20877  /* "View.MemoryView":1374
20878  * Py_ssize_t *strides, int ndim,
20879  * bint inc) with gil:
20880  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20881  *
20882  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20883  */
20884  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20885 
20886  /* "View.MemoryView":1371
20887  *
20888  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20889  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20890  * Py_ssize_t *strides, int ndim,
20891  * bint inc) with gil:
20892  */
20893 
20894  /* function exit code */
20895  __Pyx_RefNannyFinishContext();
20896  #ifdef WITH_THREAD
20897  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20898  #endif
20899 }
20900 
20901 /* "View.MemoryView":1377
20902  *
20903  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20904  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20905  * Py_ssize_t *strides, int ndim, bint inc):
20906  * cdef Py_ssize_t i
20907  */
20908 
20909 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20910  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20911  __Pyx_RefNannyDeclarations
20912  Py_ssize_t __pyx_t_1;
20913  Py_ssize_t __pyx_t_2;
20914  Py_ssize_t __pyx_t_3;
20915  int __pyx_t_4;
20916  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20917 
20918  /* "View.MemoryView":1381
20919  * cdef Py_ssize_t i
20920  *
20921  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20922  * if ndim == 1:
20923  * if inc:
20924  */
20925  __pyx_t_1 = (__pyx_v_shape[0]);
20926  __pyx_t_2 = __pyx_t_1;
20927  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20928  __pyx_v_i = __pyx_t_3;
20929 
20930  /* "View.MemoryView":1382
20931  *
20932  * for i in range(shape[0]):
20933  * if ndim == 1: # <<<<<<<<<<<<<<
20934  * if inc:
20935  * Py_INCREF((<PyObject **> data)[0])
20936  */
20937  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20938  if (__pyx_t_4) {
20939 
20940  /* "View.MemoryView":1383
20941  * for i in range(shape[0]):
20942  * if ndim == 1:
20943  * if inc: # <<<<<<<<<<<<<<
20944  * Py_INCREF((<PyObject **> data)[0])
20945  * else:
20946  */
20947  __pyx_t_4 = (__pyx_v_inc != 0);
20948  if (__pyx_t_4) {
20949 
20950  /* "View.MemoryView":1384
20951  * if ndim == 1:
20952  * if inc:
20953  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20954  * else:
20955  * Py_DECREF((<PyObject **> data)[0])
20956  */
20957  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20958 
20959  /* "View.MemoryView":1383
20960  * for i in range(shape[0]):
20961  * if ndim == 1:
20962  * if inc: # <<<<<<<<<<<<<<
20963  * Py_INCREF((<PyObject **> data)[0])
20964  * else:
20965  */
20966  goto __pyx_L6;
20967  }
20968 
20969  /* "View.MemoryView":1386
20970  * Py_INCREF((<PyObject **> data)[0])
20971  * else:
20972  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20973  * else:
20974  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20975  */
20976  /*else*/ {
20977  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20978  }
20979  __pyx_L6:;
20980 
20981  /* "View.MemoryView":1382
20982  *
20983  * for i in range(shape[0]):
20984  * if ndim == 1: # <<<<<<<<<<<<<<
20985  * if inc:
20986  * Py_INCREF((<PyObject **> data)[0])
20987  */
20988  goto __pyx_L5;
20989  }
20990 
20991  /* "View.MemoryView":1388
20992  * Py_DECREF((<PyObject **> data)[0])
20993  * else:
20994  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20995  * ndim - 1, inc)
20996  *
20997  */
20998  /*else*/ {
20999 
21000  /* "View.MemoryView":1389
21001  * else:
21002  * refcount_objects_in_slice(data, shape + 1, strides + 1,
21003  * ndim - 1, inc) # <<<<<<<<<<<<<<
21004  *
21005  * data += strides[0]
21006  */
21007  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
21008  }
21009  __pyx_L5:;
21010 
21011  /* "View.MemoryView":1391
21012  * ndim - 1, inc)
21013  *
21014  * data += strides[0] # <<<<<<<<<<<<<<
21015  *
21016  *
21017  */
21018  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
21019  }
21020 
21021  /* "View.MemoryView":1377
21022  *
21023  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21024  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21025  * Py_ssize_t *strides, int ndim, bint inc):
21026  * cdef Py_ssize_t i
21027  */
21028 
21029  /* function exit code */
21030  __Pyx_RefNannyFinishContext();
21031 }
21032 
21033 /* "View.MemoryView":1397
21034  *
21035  * @cname('__pyx_memoryview_slice_assign_scalar')
21036  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21037  * size_t itemsize, void *item,
21038  * bint dtype_is_object) nogil:
21039  */
21040 
21041 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
21042 
21043  /* "View.MemoryView":1400
21044  * size_t itemsize, void *item,
21045  * bint dtype_is_object) nogil:
21046  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
21047  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21048  * itemsize, item)
21049  */
21050  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21051 
21052  /* "View.MemoryView":1401
21053  * bint dtype_is_object) nogil:
21054  * refcount_copying(dst, dtype_is_object, ndim, False)
21055  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
21056  * itemsize, item)
21057  * refcount_copying(dst, dtype_is_object, ndim, True)
21058  */
21059  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
21060 
21061  /* "View.MemoryView":1403
21062  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21063  * itemsize, item)
21064  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
21065  *
21066  *
21067  */
21068  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21069 
21070  /* "View.MemoryView":1397
21071  *
21072  * @cname('__pyx_memoryview_slice_assign_scalar')
21073  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21074  * size_t itemsize, void *item,
21075  * bint dtype_is_object) nogil:
21076  */
21077 
21078  /* function exit code */
21079 }
21080 
21081 /* "View.MemoryView":1407
21082  *
21083  * @cname('__pyx_memoryview__slice_assign_scalar')
21084  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21085  * Py_ssize_t *strides, int ndim,
21086  * size_t itemsize, void *item) nogil:
21087  */
21088 
21089 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
21090  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21091  Py_ssize_t __pyx_v_stride;
21092  Py_ssize_t __pyx_v_extent;
21093  int __pyx_t_1;
21094  Py_ssize_t __pyx_t_2;
21095  Py_ssize_t __pyx_t_3;
21096  Py_ssize_t __pyx_t_4;
21097 
21098  /* "View.MemoryView":1411
21099  * size_t itemsize, void *item) nogil:
21100  * cdef Py_ssize_t i
21101  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
21102  * cdef Py_ssize_t extent = shape[0]
21103  *
21104  */
21105  __pyx_v_stride = (__pyx_v_strides[0]);
21106 
21107  /* "View.MemoryView":1412
21108  * cdef Py_ssize_t i
21109  * cdef Py_ssize_t stride = strides[0]
21110  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
21111  *
21112  * if ndim == 1:
21113  */
21114  __pyx_v_extent = (__pyx_v_shape[0]);
21115 
21116  /* "View.MemoryView":1414
21117  * cdef Py_ssize_t extent = shape[0]
21118  *
21119  * if ndim == 1: # <<<<<<<<<<<<<<
21120  * for i in range(extent):
21121  * memcpy(data, item, itemsize)
21122  */
21123  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21124  if (__pyx_t_1) {
21125 
21126  /* "View.MemoryView":1415
21127  *
21128  * if ndim == 1:
21129  * for i in range(extent): # <<<<<<<<<<<<<<
21130  * memcpy(data, item, itemsize)
21131  * data += stride
21132  */
21133  __pyx_t_2 = __pyx_v_extent;
21134  __pyx_t_3 = __pyx_t_2;
21135  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21136  __pyx_v_i = __pyx_t_4;
21137 
21138  /* "View.MemoryView":1416
21139  * if ndim == 1:
21140  * for i in range(extent):
21141  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
21142  * data += stride
21143  * else:
21144  */
21145  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
21146 
21147  /* "View.MemoryView":1417
21148  * for i in range(extent):
21149  * memcpy(data, item, itemsize)
21150  * data += stride # <<<<<<<<<<<<<<
21151  * else:
21152  * for i in range(extent):
21153  */
21154  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21155  }
21156 
21157  /* "View.MemoryView":1414
21158  * cdef Py_ssize_t extent = shape[0]
21159  *
21160  * if ndim == 1: # <<<<<<<<<<<<<<
21161  * for i in range(extent):
21162  * memcpy(data, item, itemsize)
21163  */
21164  goto __pyx_L3;
21165  }
21166 
21167  /* "View.MemoryView":1419
21168  * data += stride
21169  * else:
21170  * for i in range(extent): # <<<<<<<<<<<<<<
21171  * _slice_assign_scalar(data, shape + 1, strides + 1,
21172  * ndim - 1, itemsize, item)
21173  */
21174  /*else*/ {
21175  __pyx_t_2 = __pyx_v_extent;
21176  __pyx_t_3 = __pyx_t_2;
21177  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21178  __pyx_v_i = __pyx_t_4;
21179 
21180  /* "View.MemoryView":1420
21181  * else:
21182  * for i in range(extent):
21183  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
21184  * ndim - 1, itemsize, item)
21185  * data += stride
21186  */
21187  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
21188 
21189  /* "View.MemoryView":1422
21190  * _slice_assign_scalar(data, shape + 1, strides + 1,
21191  * ndim - 1, itemsize, item)
21192  * data += stride # <<<<<<<<<<<<<<
21193  *
21194  *
21195  */
21196  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21197  }
21198  }
21199  __pyx_L3:;
21200 
21201  /* "View.MemoryView":1407
21202  *
21203  * @cname('__pyx_memoryview__slice_assign_scalar')
21204  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21205  * Py_ssize_t *strides, int ndim,
21206  * size_t itemsize, void *item) nogil:
21207  */
21208 
21209  /* function exit code */
21210 }
21211 
21212 /* "(tree fragment)":1
21213  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21214  * cdef object __pyx_PickleError
21215  * cdef object __pyx_result
21216  */
21217 
21218 /* Python wrapper */
21219 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
21220 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
21221 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21222  PyObject *__pyx_v___pyx_type = 0;
21223  long __pyx_v___pyx_checksum;
21224  PyObject *__pyx_v___pyx_state = 0;
21225  int __pyx_lineno = 0;
21226  const char *__pyx_filename = NULL;
21227  int __pyx_clineno = 0;
21228  PyObject *__pyx_r = 0;
21229  __Pyx_RefNannyDeclarations
21230  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
21231  {
21232  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21233  PyObject* values[3] = {0,0,0};
21234  if (unlikely(__pyx_kwds)) {
21235  Py_ssize_t kw_args;
21236  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21237  switch (pos_args) {
21238  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21239  CYTHON_FALLTHROUGH;
21240  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21241  CYTHON_FALLTHROUGH;
21242  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21243  CYTHON_FALLTHROUGH;
21244  case 0: break;
21245  default: goto __pyx_L5_argtuple_error;
21246  }
21247  kw_args = PyDict_Size(__pyx_kwds);
21248  switch (pos_args) {
21249  case 0:
21250  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21251  else goto __pyx_L5_argtuple_error;
21252  CYTHON_FALLTHROUGH;
21253  case 1:
21254  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21255  else {
21256  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
21257  }
21258  CYTHON_FALLTHROUGH;
21259  case 2:
21260  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21261  else {
21262  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
21263  }
21264  }
21265  if (unlikely(kw_args > 0)) {
21266  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
21267  }
21268  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21269  goto __pyx_L5_argtuple_error;
21270  } else {
21271  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21272  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21273  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21274  }
21275  __pyx_v___pyx_type = values[0];
21276  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
21277  __pyx_v___pyx_state = values[2];
21278  }
21279  goto __pyx_L4_argument_unpacking_done;
21280  __pyx_L5_argtuple_error:;
21281  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
21282  __pyx_L3_error:;
21283  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21284  __Pyx_RefNannyFinishContext();
21285  return NULL;
21286  __pyx_L4_argument_unpacking_done:;
21287  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21288 
21289  /* function exit code */
21290  __Pyx_RefNannyFinishContext();
21291  return __pyx_r;
21292 }
21293 
21294 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
21295  PyObject *__pyx_v___pyx_PickleError = 0;
21296  PyObject *__pyx_v___pyx_result = 0;
21297  PyObject *__pyx_r = NULL;
21298  __Pyx_RefNannyDeclarations
21299  int __pyx_t_1;
21300  PyObject *__pyx_t_2 = NULL;
21301  PyObject *__pyx_t_3 = NULL;
21302  PyObject *__pyx_t_4 = NULL;
21303  PyObject *__pyx_t_5 = NULL;
21304  int __pyx_t_6;
21305  int __pyx_lineno = 0;
21306  const char *__pyx_filename = NULL;
21307  int __pyx_clineno = 0;
21308  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
21309 
21310  /* "(tree fragment)":4
21311  * cdef object __pyx_PickleError
21312  * cdef object __pyx_result
21313  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21314  * from pickle import PickleError as __pyx_PickleError
21315  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21316  */
21317  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21318  if (__pyx_t_1) {
21319 
21320  /* "(tree fragment)":5
21321  * cdef object __pyx_result
21322  * if __pyx_checksum != 0xb068931:
21323  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
21324  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21325  * __pyx_result = Enum.__new__(__pyx_type)
21326  */
21327  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21328  __Pyx_GOTREF(__pyx_t_2);
21329  __Pyx_INCREF(__pyx_n_s_PickleError);
21330  __Pyx_GIVEREF(__pyx_n_s_PickleError);
21331  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21332  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21333  __Pyx_GOTREF(__pyx_t_3);
21334  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21335  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21336  __Pyx_GOTREF(__pyx_t_2);
21337  __Pyx_INCREF(__pyx_t_2);
21338  __pyx_v___pyx_PickleError = __pyx_t_2;
21339  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21340  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21341 
21342  /* "(tree fragment)":6
21343  * if __pyx_checksum != 0xb068931:
21344  * from pickle import PickleError as __pyx_PickleError
21345  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
21346  * __pyx_result = Enum.__new__(__pyx_type)
21347  * if __pyx_state is not None:
21348  */
21349  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
21350  __Pyx_GOTREF(__pyx_t_2);
21351  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
21352  __Pyx_GOTREF(__pyx_t_4);
21353  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21354  __Pyx_INCREF(__pyx_v___pyx_PickleError);
21355  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21356  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21357  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21358  if (likely(__pyx_t_5)) {
21359  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21360  __Pyx_INCREF(__pyx_t_5);
21361  __Pyx_INCREF(function);
21362  __Pyx_DECREF_SET(__pyx_t_2, function);
21363  }
21364  }
21365  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
21366  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21367  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21368  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
21369  __Pyx_GOTREF(__pyx_t_3);
21370  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21371  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21372  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21373  __PYX_ERR(1, 6, __pyx_L1_error)
21374 
21375  /* "(tree fragment)":4
21376  * cdef object __pyx_PickleError
21377  * cdef object __pyx_result
21378  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21379  * from pickle import PickleError as __pyx_PickleError
21380  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21381  */
21382  }
21383 
21384  /* "(tree fragment)":7
21385  * from pickle import PickleError as __pyx_PickleError
21386  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21387  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
21388  * if __pyx_state is not None:
21389  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21390  */
21391  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
21392  __Pyx_GOTREF(__pyx_t_2);
21393  __pyx_t_4 = NULL;
21394  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21395  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21396  if (likely(__pyx_t_4)) {
21397  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21398  __Pyx_INCREF(__pyx_t_4);
21399  __Pyx_INCREF(function);
21400  __Pyx_DECREF_SET(__pyx_t_2, function);
21401  }
21402  }
21403  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
21404  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21405  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21406  __Pyx_GOTREF(__pyx_t_3);
21407  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21408  __pyx_v___pyx_result = __pyx_t_3;
21409  __pyx_t_3 = 0;
21410 
21411  /* "(tree fragment)":8
21412  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21413  * __pyx_result = Enum.__new__(__pyx_type)
21414  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21415  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21416  * return __pyx_result
21417  */
21418  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21419  __pyx_t_6 = (__pyx_t_1 != 0);
21420  if (__pyx_t_6) {
21421 
21422  /* "(tree fragment)":9
21423  * __pyx_result = Enum.__new__(__pyx_type)
21424  * if __pyx_state is not None:
21425  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21426  * return __pyx_result
21427  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21428  */
21429  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
21430  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
21431  __Pyx_GOTREF(__pyx_t_3);
21432  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21433 
21434  /* "(tree fragment)":8
21435  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21436  * __pyx_result = Enum.__new__(__pyx_type)
21437  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21438  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21439  * return __pyx_result
21440  */
21441  }
21442 
21443  /* "(tree fragment)":10
21444  * if __pyx_state is not None:
21445  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21446  * return __pyx_result # <<<<<<<<<<<<<<
21447  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21448  * __pyx_result.name = __pyx_state[0]
21449  */
21450  __Pyx_XDECREF(__pyx_r);
21451  __Pyx_INCREF(__pyx_v___pyx_result);
21452  __pyx_r = __pyx_v___pyx_result;
21453  goto __pyx_L0;
21454 
21455  /* "(tree fragment)":1
21456  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21457  * cdef object __pyx_PickleError
21458  * cdef object __pyx_result
21459  */
21460 
21461  /* function exit code */
21462  __pyx_L1_error:;
21463  __Pyx_XDECREF(__pyx_t_2);
21464  __Pyx_XDECREF(__pyx_t_3);
21465  __Pyx_XDECREF(__pyx_t_4);
21466  __Pyx_XDECREF(__pyx_t_5);
21467  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21468  __pyx_r = NULL;
21469  __pyx_L0:;
21470  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21471  __Pyx_XDECREF(__pyx_v___pyx_result);
21472  __Pyx_XGIVEREF(__pyx_r);
21473  __Pyx_RefNannyFinishContext();
21474  return __pyx_r;
21475 }
21476 
21477 /* "(tree fragment)":11
21478  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21479  * return __pyx_result
21480  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21481  * __pyx_result.name = __pyx_state[0]
21482  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21483  */
21484 
21485 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21486  PyObject *__pyx_r = NULL;
21487  __Pyx_RefNannyDeclarations
21488  PyObject *__pyx_t_1 = NULL;
21489  int __pyx_t_2;
21490  Py_ssize_t __pyx_t_3;
21491  int __pyx_t_4;
21492  int __pyx_t_5;
21493  PyObject *__pyx_t_6 = NULL;
21494  PyObject *__pyx_t_7 = NULL;
21495  PyObject *__pyx_t_8 = NULL;
21496  int __pyx_lineno = 0;
21497  const char *__pyx_filename = NULL;
21498  int __pyx_clineno = 0;
21499  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21500 
21501  /* "(tree fragment)":12
21502  * return __pyx_result
21503  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21504  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21505  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21506  * __pyx_result.__dict__.update(__pyx_state[1])
21507  */
21508  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21509  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21510  __PYX_ERR(1, 12, __pyx_L1_error)
21511  }
21512  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21513  __Pyx_GOTREF(__pyx_t_1);
21514  __Pyx_GIVEREF(__pyx_t_1);
21515  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21516  __Pyx_DECREF(__pyx_v___pyx_result->name);
21517  __pyx_v___pyx_result->name = __pyx_t_1;
21518  __pyx_t_1 = 0;
21519 
21520  /* "(tree fragment)":13
21521  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21522  * __pyx_result.name = __pyx_state[0]
21523  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21524  * __pyx_result.__dict__.update(__pyx_state[1])
21525  */
21526  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21527  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21528  __PYX_ERR(1, 13, __pyx_L1_error)
21529  }
21530  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21531  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21532  if (__pyx_t_4) {
21533  } else {
21534  __pyx_t_2 = __pyx_t_4;
21535  goto __pyx_L4_bool_binop_done;
21536  }
21537  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21538  __pyx_t_5 = (__pyx_t_4 != 0);
21539  __pyx_t_2 = __pyx_t_5;
21540  __pyx_L4_bool_binop_done:;
21541  if (__pyx_t_2) {
21542 
21543  /* "(tree fragment)":14
21544  * __pyx_result.name = __pyx_state[0]
21545  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21546  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21547  */
21548  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21549  __Pyx_GOTREF(__pyx_t_6);
21550  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21551  __Pyx_GOTREF(__pyx_t_7);
21552  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21553  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21554  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21555  __PYX_ERR(1, 14, __pyx_L1_error)
21556  }
21557  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21558  __Pyx_GOTREF(__pyx_t_6);
21559  __pyx_t_8 = NULL;
21560  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21561  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21562  if (likely(__pyx_t_8)) {
21563  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21564  __Pyx_INCREF(__pyx_t_8);
21565  __Pyx_INCREF(function);
21566  __Pyx_DECREF_SET(__pyx_t_7, function);
21567  }
21568  }
21569  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21570  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21571  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21572  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21573  __Pyx_GOTREF(__pyx_t_1);
21574  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21575  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21576 
21577  /* "(tree fragment)":13
21578  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21579  * __pyx_result.name = __pyx_state[0]
21580  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21581  * __pyx_result.__dict__.update(__pyx_state[1])
21582  */
21583  }
21584 
21585  /* "(tree fragment)":11
21586  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21587  * return __pyx_result
21588  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21589  * __pyx_result.name = __pyx_state[0]
21590  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21591  */
21592 
21593  /* function exit code */
21594  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21595  goto __pyx_L0;
21596  __pyx_L1_error:;
21597  __Pyx_XDECREF(__pyx_t_1);
21598  __Pyx_XDECREF(__pyx_t_6);
21599  __Pyx_XDECREF(__pyx_t_7);
21600  __Pyx_XDECREF(__pyx_t_8);
21601  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21602  __pyx_r = 0;
21603  __pyx_L0:;
21604  __Pyx_XGIVEREF(__pyx_r);
21605  __Pyx_RefNannyFinishContext();
21606  return __pyx_r;
21607 }
21608 
21609 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
21610  PyObject *o;
21611  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21612  o = (*t->tp_alloc)(t, 0);
21613  } else {
21614  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21615  }
21616  if (unlikely(!o)) return 0;
21617  if (unlikely(__pyx_pw_10csmoothers_10cASMFactor_1__cinit__(o, a, k) < 0)) goto bad;
21618  return o;
21619  bad:
21620  Py_DECREF(o); o = 0;
21621  return NULL;
21622 }
21623 
21624 static void __pyx_tp_dealloc_10csmoothers_cASMFactor(PyObject *o) {
21625  #if CYTHON_USE_TP_FINALIZE
21626  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21627  if (PyObject_CallFinalizerFromDealloc(o)) return;
21628  }
21629  #endif
21630  {
21631  PyObject *etype, *eval, *etb;
21632  PyErr_Fetch(&etype, &eval, &etb);
21633  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21634  __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(o);
21635  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21636  PyErr_Restore(etype, eval, etb);
21637  }
21638  (*Py_TYPE(o)->tp_free)(o);
21639 }
21640 
21641 static PyMethodDef __pyx_methods_10csmoothers_cASMFactor[] = {
21642  {"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, METH_NOARGS, 0},
21643  {"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, METH_O, 0},
21644  {0, 0, 0, 0}
21645 };
21646 
21647 static PyTypeObject __pyx_type_10csmoothers_cASMFactor = {
21648  PyVarObject_HEAD_INIT(0, 0)
21649  "csmoothers.cASMFactor", /*tp_name*/
21650  sizeof(struct __pyx_obj_10csmoothers_cASMFactor), /*tp_basicsize*/
21651  0, /*tp_itemsize*/
21652  __pyx_tp_dealloc_10csmoothers_cASMFactor, /*tp_dealloc*/
21653  #if PY_VERSION_HEX < 0x030800b4
21654  0, /*tp_print*/
21655  #endif
21656  #if PY_VERSION_HEX >= 0x030800b4
21657  0, /*tp_vectorcall_offset*/
21658  #endif
21659  0, /*tp_getattr*/
21660  0, /*tp_setattr*/
21661  #if PY_MAJOR_VERSION < 3
21662  0, /*tp_compare*/
21663  #endif
21664  #if PY_MAJOR_VERSION >= 3
21665  0, /*tp_as_async*/
21666  #endif
21667  0, /*tp_repr*/
21668  0, /*tp_as_number*/
21669  0, /*tp_as_sequence*/
21670  0, /*tp_as_mapping*/
21671  0, /*tp_hash*/
21672  0, /*tp_call*/
21673  0, /*tp_str*/
21674  0, /*tp_getattro*/
21675  0, /*tp_setattro*/
21676  0, /*tp_as_buffer*/
21677  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21678  0, /*tp_doc*/
21679  0, /*tp_traverse*/
21680  0, /*tp_clear*/
21681  0, /*tp_richcompare*/
21682  0, /*tp_weaklistoffset*/
21683  0, /*tp_iter*/
21684  0, /*tp_iternext*/
21685  __pyx_methods_10csmoothers_cASMFactor, /*tp_methods*/
21686  0, /*tp_members*/
21687  0, /*tp_getset*/
21688  0, /*tp_base*/
21689  0, /*tp_dict*/
21690  0, /*tp_descr_get*/
21691  0, /*tp_descr_set*/
21692  0, /*tp_dictoffset*/
21693  0, /*tp_init*/
21694  0, /*tp_alloc*/
21695  __pyx_tp_new_10csmoothers_cASMFactor, /*tp_new*/
21696  0, /*tp_free*/
21697  0, /*tp_is_gc*/
21698  0, /*tp_bases*/
21699  0, /*tp_mro*/
21700  0, /*tp_cache*/
21701  0, /*tp_subclasses*/
21702  0, /*tp_weaklist*/
21703  0, /*tp_del*/
21704  0, /*tp_version_tag*/
21705  #if PY_VERSION_HEX >= 0x030400a1
21706  0, /*tp_finalize*/
21707  #endif
21708  #if PY_VERSION_HEX >= 0x030800b1
21709  0, /*tp_vectorcall*/
21710  #endif
21711  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21712  0, /*tp_print*/
21713  #endif
21714 };
21715 
21716 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
21717  PyObject *o;
21718  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21719  o = (*t->tp_alloc)(t, 0);
21720  } else {
21721  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21722  }
21723  if (unlikely(!o)) return 0;
21724  if (unlikely(__pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(o, a, k) < 0)) goto bad;
21725  return o;
21726  bad:
21727  Py_DECREF(o); o = 0;
21728  return NULL;
21729 }
21730 
21731 static void __pyx_tp_dealloc_10csmoothers_cBASMFactor(PyObject *o) {
21732  #if CYTHON_USE_TP_FINALIZE
21733  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21734  if (PyObject_CallFinalizerFromDealloc(o)) return;
21735  }
21736  #endif
21737  {
21738  PyObject *etype, *eval, *etb;
21739  PyErr_Fetch(&etype, &eval, &etb);
21740  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21741  __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(o);
21742  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21743  PyErr_Restore(etype, eval, etb);
21744  }
21745  (*Py_TYPE(o)->tp_free)(o);
21746 }
21747 
21748 static PyMethodDef __pyx_methods_10csmoothers_cBASMFactor[] = {
21749  {"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, METH_NOARGS, 0},
21750  {"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, METH_O, 0},
21751  {0, 0, 0, 0}
21752 };
21753 
21754 static PyTypeObject __pyx_type_10csmoothers_cBASMFactor = {
21755  PyVarObject_HEAD_INIT(0, 0)
21756  "csmoothers.cBASMFactor", /*tp_name*/
21757  sizeof(struct __pyx_obj_10csmoothers_cBASMFactor), /*tp_basicsize*/
21758  0, /*tp_itemsize*/
21759  __pyx_tp_dealloc_10csmoothers_cBASMFactor, /*tp_dealloc*/
21760  #if PY_VERSION_HEX < 0x030800b4
21761  0, /*tp_print*/
21762  #endif
21763  #if PY_VERSION_HEX >= 0x030800b4
21764  0, /*tp_vectorcall_offset*/
21765  #endif
21766  0, /*tp_getattr*/
21767  0, /*tp_setattr*/
21768  #if PY_MAJOR_VERSION < 3
21769  0, /*tp_compare*/
21770  #endif
21771  #if PY_MAJOR_VERSION >= 3
21772  0, /*tp_as_async*/
21773  #endif
21774  0, /*tp_repr*/
21775  0, /*tp_as_number*/
21776  0, /*tp_as_sequence*/
21777  0, /*tp_as_mapping*/
21778  0, /*tp_hash*/
21779  0, /*tp_call*/
21780  0, /*tp_str*/
21781  0, /*tp_getattro*/
21782  0, /*tp_setattro*/
21783  0, /*tp_as_buffer*/
21784  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21785  0, /*tp_doc*/
21786  0, /*tp_traverse*/
21787  0, /*tp_clear*/
21788  0, /*tp_richcompare*/
21789  0, /*tp_weaklistoffset*/
21790  0, /*tp_iter*/
21791  0, /*tp_iternext*/
21792  __pyx_methods_10csmoothers_cBASMFactor, /*tp_methods*/
21793  0, /*tp_members*/
21794  0, /*tp_getset*/
21795  0, /*tp_base*/
21796  0, /*tp_dict*/
21797  0, /*tp_descr_get*/
21798  0, /*tp_descr_set*/
21799  0, /*tp_dictoffset*/
21800  0, /*tp_init*/
21801  0, /*tp_alloc*/
21802  __pyx_tp_new_10csmoothers_cBASMFactor, /*tp_new*/
21803  0, /*tp_free*/
21804  0, /*tp_is_gc*/
21805  0, /*tp_bases*/
21806  0, /*tp_mro*/
21807  0, /*tp_cache*/
21808  0, /*tp_subclasses*/
21809  0, /*tp_weaklist*/
21810  0, /*tp_del*/
21811  0, /*tp_version_tag*/
21812  #if PY_VERSION_HEX >= 0x030400a1
21813  0, /*tp_finalize*/
21814  #endif
21815  #if PY_VERSION_HEX >= 0x030800b1
21816  0, /*tp_vectorcall*/
21817  #endif
21818  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21819  0, /*tp_print*/
21820  #endif
21821 };
21822 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21823 
21824 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21825  struct __pyx_array_obj *p;
21826  PyObject *o;
21827  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21828  o = (*t->tp_alloc)(t, 0);
21829  } else {
21830  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21831  }
21832  if (unlikely(!o)) return 0;
21833  p = ((struct __pyx_array_obj *)o);
21834  p->__pyx_vtab = __pyx_vtabptr_array;
21835  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21836  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21837  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21838  return o;
21839  bad:
21840  Py_DECREF(o); o = 0;
21841  return NULL;
21842 }
21843 
21844 static void __pyx_tp_dealloc_array(PyObject *o) {
21845  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21846  #if CYTHON_USE_TP_FINALIZE
21847  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21848  if (PyObject_CallFinalizerFromDealloc(o)) return;
21849  }
21850  #endif
21851  {
21852  PyObject *etype, *eval, *etb;
21853  PyErr_Fetch(&etype, &eval, &etb);
21854  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21855  __pyx_array___dealloc__(o);
21856  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21857  PyErr_Restore(etype, eval, etb);
21858  }
21859  Py_CLEAR(p->mode);
21860  Py_CLEAR(p->_format);
21861  (*Py_TYPE(o)->tp_free)(o);
21862 }
21863 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21864  PyObject *r;
21865  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21866  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21867  Py_DECREF(x);
21868  return r;
21869 }
21870 
21871 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21872  if (v) {
21873  return __pyx_array___setitem__(o, i, v);
21874  }
21875  else {
21876  PyErr_Format(PyExc_NotImplementedError,
21877  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21878  return -1;
21879  }
21880 }
21881 
21882 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21883  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21884  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21885  PyErr_Clear();
21886  v = __pyx_array___getattr__(o, n);
21887  }
21888  return v;
21889 }
21890 
21891 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21892  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21893 }
21894 
21895 static PyMethodDef __pyx_methods_array[] = {
21896  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21897  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21898  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21899  {0, 0, 0, 0}
21900 };
21901 
21902 static struct PyGetSetDef __pyx_getsets_array[] = {
21903  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21904  {0, 0, 0, 0, 0}
21905 };
21906 
21907 static PySequenceMethods __pyx_tp_as_sequence_array = {
21908  __pyx_array___len__, /*sq_length*/
21909  0, /*sq_concat*/
21910  0, /*sq_repeat*/
21911  __pyx_sq_item_array, /*sq_item*/
21912  0, /*sq_slice*/
21913  0, /*sq_ass_item*/
21914  0, /*sq_ass_slice*/
21915  0, /*sq_contains*/
21916  0, /*sq_inplace_concat*/
21917  0, /*sq_inplace_repeat*/
21918 };
21919 
21920 static PyMappingMethods __pyx_tp_as_mapping_array = {
21921  __pyx_array___len__, /*mp_length*/
21922  __pyx_array___getitem__, /*mp_subscript*/
21923  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21924 };
21925 
21926 static PyBufferProcs __pyx_tp_as_buffer_array = {
21927  #if PY_MAJOR_VERSION < 3
21928  0, /*bf_getreadbuffer*/
21929  #endif
21930  #if PY_MAJOR_VERSION < 3
21931  0, /*bf_getwritebuffer*/
21932  #endif
21933  #if PY_MAJOR_VERSION < 3
21934  0, /*bf_getsegcount*/
21935  #endif
21936  #if PY_MAJOR_VERSION < 3
21937  0, /*bf_getcharbuffer*/
21938  #endif
21939  __pyx_array_getbuffer, /*bf_getbuffer*/
21940  0, /*bf_releasebuffer*/
21941 };
21942 
21943 static PyTypeObject __pyx_type___pyx_array = {
21944  PyVarObject_HEAD_INIT(0, 0)
21945  "csmoothers.array", /*tp_name*/
21946  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21947  0, /*tp_itemsize*/
21948  __pyx_tp_dealloc_array, /*tp_dealloc*/
21949  #if PY_VERSION_HEX < 0x030800b4
21950  0, /*tp_print*/
21951  #endif
21952  #if PY_VERSION_HEX >= 0x030800b4
21953  0, /*tp_vectorcall_offset*/
21954  #endif
21955  0, /*tp_getattr*/
21956  0, /*tp_setattr*/
21957  #if PY_MAJOR_VERSION < 3
21958  0, /*tp_compare*/
21959  #endif
21960  #if PY_MAJOR_VERSION >= 3
21961  0, /*tp_as_async*/
21962  #endif
21963  0, /*tp_repr*/
21964  0, /*tp_as_number*/
21965  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21966  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21967  0, /*tp_hash*/
21968  0, /*tp_call*/
21969  0, /*tp_str*/
21970  __pyx_tp_getattro_array, /*tp_getattro*/
21971  0, /*tp_setattro*/
21972  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21973  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21974  0, /*tp_doc*/
21975  0, /*tp_traverse*/
21976  0, /*tp_clear*/
21977  0, /*tp_richcompare*/
21978  0, /*tp_weaklistoffset*/
21979  0, /*tp_iter*/
21980  0, /*tp_iternext*/
21981  __pyx_methods_array, /*tp_methods*/
21982  0, /*tp_members*/
21983  __pyx_getsets_array, /*tp_getset*/
21984  0, /*tp_base*/
21985  0, /*tp_dict*/
21986  0, /*tp_descr_get*/
21987  0, /*tp_descr_set*/
21988  0, /*tp_dictoffset*/
21989  0, /*tp_init*/
21990  0, /*tp_alloc*/
21991  __pyx_tp_new_array, /*tp_new*/
21992  0, /*tp_free*/
21993  0, /*tp_is_gc*/
21994  0, /*tp_bases*/
21995  0, /*tp_mro*/
21996  0, /*tp_cache*/
21997  0, /*tp_subclasses*/
21998  0, /*tp_weaklist*/
21999  0, /*tp_del*/
22000  0, /*tp_version_tag*/
22001  #if PY_VERSION_HEX >= 0x030400a1
22002  0, /*tp_finalize*/
22003  #endif
22004  #if PY_VERSION_HEX >= 0x030800b1
22005  0, /*tp_vectorcall*/
22006  #endif
22007  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22008  0, /*tp_print*/
22009  #endif
22010 };
22011 
22012 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22013  struct __pyx_MemviewEnum_obj *p;
22014  PyObject *o;
22015  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22016  o = (*t->tp_alloc)(t, 0);
22017  } else {
22018  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22019  }
22020  if (unlikely(!o)) return 0;
22021  p = ((struct __pyx_MemviewEnum_obj *)o);
22022  p->name = Py_None; Py_INCREF(Py_None);
22023  return o;
22024 }
22025 
22026 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22027  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22028  #if CYTHON_USE_TP_FINALIZE
22029  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22030  if (PyObject_CallFinalizerFromDealloc(o)) return;
22031  }
22032  #endif
22033  PyObject_GC_UnTrack(o);
22034  Py_CLEAR(p->name);
22035  (*Py_TYPE(o)->tp_free)(o);
22036 }
22037 
22038 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
22039  int e;
22040  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22041  if (p->name) {
22042  e = (*v)(p->name, a); if (e) return e;
22043  }
22044  return 0;
22045 }
22046 
22047 static int __pyx_tp_clear_Enum(PyObject *o) {
22048  PyObject* tmp;
22049  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22050  tmp = ((PyObject*)p->name);
22051  p->name = Py_None; Py_INCREF(Py_None);
22052  Py_XDECREF(tmp);
22053  return 0;
22054 }
22055 
22056 static PyMethodDef __pyx_methods_Enum[] = {
22057  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22058  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22059  {0, 0, 0, 0}
22060 };
22061 
22062 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22063  PyVarObject_HEAD_INIT(0, 0)
22064  "csmoothers.Enum", /*tp_name*/
22065  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
22066  0, /*tp_itemsize*/
22067  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
22068  #if PY_VERSION_HEX < 0x030800b4
22069  0, /*tp_print*/
22070  #endif
22071  #if PY_VERSION_HEX >= 0x030800b4
22072  0, /*tp_vectorcall_offset*/
22073  #endif
22074  0, /*tp_getattr*/
22075  0, /*tp_setattr*/
22076  #if PY_MAJOR_VERSION < 3
22077  0, /*tp_compare*/
22078  #endif
22079  #if PY_MAJOR_VERSION >= 3
22080  0, /*tp_as_async*/
22081  #endif
22082  __pyx_MemviewEnum___repr__, /*tp_repr*/
22083  0, /*tp_as_number*/
22084  0, /*tp_as_sequence*/
22085  0, /*tp_as_mapping*/
22086  0, /*tp_hash*/
22087  0, /*tp_call*/
22088  0, /*tp_str*/
22089  0, /*tp_getattro*/
22090  0, /*tp_setattro*/
22091  0, /*tp_as_buffer*/
22092  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22093  0, /*tp_doc*/
22094  __pyx_tp_traverse_Enum, /*tp_traverse*/
22095  __pyx_tp_clear_Enum, /*tp_clear*/
22096  0, /*tp_richcompare*/
22097  0, /*tp_weaklistoffset*/
22098  0, /*tp_iter*/
22099  0, /*tp_iternext*/
22100  __pyx_methods_Enum, /*tp_methods*/
22101  0, /*tp_members*/
22102  0, /*tp_getset*/
22103  0, /*tp_base*/
22104  0, /*tp_dict*/
22105  0, /*tp_descr_get*/
22106  0, /*tp_descr_set*/
22107  0, /*tp_dictoffset*/
22108  __pyx_MemviewEnum___init__, /*tp_init*/
22109  0, /*tp_alloc*/
22110  __pyx_tp_new_Enum, /*tp_new*/
22111  0, /*tp_free*/
22112  0, /*tp_is_gc*/
22113  0, /*tp_bases*/
22114  0, /*tp_mro*/
22115  0, /*tp_cache*/
22116  0, /*tp_subclasses*/
22117  0, /*tp_weaklist*/
22118  0, /*tp_del*/
22119  0, /*tp_version_tag*/
22120  #if PY_VERSION_HEX >= 0x030400a1
22121  0, /*tp_finalize*/
22122  #endif
22123  #if PY_VERSION_HEX >= 0x030800b1
22124  0, /*tp_vectorcall*/
22125  #endif
22126  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22127  0, /*tp_print*/
22128  #endif
22129 };
22130 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22131 
22132 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22133  struct __pyx_memoryview_obj *p;
22134  PyObject *o;
22135  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22136  o = (*t->tp_alloc)(t, 0);
22137  } else {
22138  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22139  }
22140  if (unlikely(!o)) return 0;
22141  p = ((struct __pyx_memoryview_obj *)o);
22142  p->__pyx_vtab = __pyx_vtabptr_memoryview;
22143  p->obj = Py_None; Py_INCREF(Py_None);
22144  p->_size = Py_None; Py_INCREF(Py_None);
22145  p->_array_interface = Py_None; Py_INCREF(Py_None);
22146  p->view.obj = NULL;
22147  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
22148  return o;
22149  bad:
22150  Py_DECREF(o); o = 0;
22151  return NULL;
22152 }
22153 
22154 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22155  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22156  #if CYTHON_USE_TP_FINALIZE
22157  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22158  if (PyObject_CallFinalizerFromDealloc(o)) return;
22159  }
22160  #endif
22161  PyObject_GC_UnTrack(o);
22162  {
22163  PyObject *etype, *eval, *etb;
22164  PyErr_Fetch(&etype, &eval, &etb);
22165  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22166  __pyx_memoryview___dealloc__(o);
22167  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22168  PyErr_Restore(etype, eval, etb);
22169  }
22170  Py_CLEAR(p->obj);
22171  Py_CLEAR(p->_size);
22172  Py_CLEAR(p->_array_interface);
22173  (*Py_TYPE(o)->tp_free)(o);
22174 }
22175 
22176 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
22177  int e;
22178  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22179  if (p->obj) {
22180  e = (*v)(p->obj, a); if (e) return e;
22181  }
22182  if (p->_size) {
22183  e = (*v)(p->_size, a); if (e) return e;
22184  }
22185  if (p->_array_interface) {
22186  e = (*v)(p->_array_interface, a); if (e) return e;
22187  }
22188  if (p->view.obj) {
22189  e = (*v)(p->view.obj, a); if (e) return e;
22190  }
22191  return 0;
22192 }
22193 
22194 static int __pyx_tp_clear_memoryview(PyObject *o) {
22195  PyObject* tmp;
22196  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22197  tmp = ((PyObject*)p->obj);
22198  p->obj = Py_None; Py_INCREF(Py_None);
22199  Py_XDECREF(tmp);
22200  tmp = ((PyObject*)p->_size);
22201  p->_size = Py_None; Py_INCREF(Py_None);
22202  Py_XDECREF(tmp);
22203  tmp = ((PyObject*)p->_array_interface);
22204  p->_array_interface = Py_None; Py_INCREF(Py_None);
22205  Py_XDECREF(tmp);
22206  Py_CLEAR(p->view.obj);
22207  return 0;
22208 }
22209 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22210  PyObject *r;
22211  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22212  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22213  Py_DECREF(x);
22214  return r;
22215 }
22216 
22217 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
22218  if (v) {
22219  return __pyx_memoryview___setitem__(o, i, v);
22220  }
22221  else {
22222  PyErr_Format(PyExc_NotImplementedError,
22223  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22224  return -1;
22225  }
22226 }
22227 
22228 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
22229  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22230 }
22231 
22232 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
22233  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22234 }
22235 
22236 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
22237  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22238 }
22239 
22240 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
22241  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22242 }
22243 
22244 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
22245  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22246 }
22247 
22248 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
22249  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22250 }
22251 
22252 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
22253  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22254 }
22255 
22256 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
22257  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22258 }
22259 
22260 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
22261  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22262 }
22263 
22264 static PyMethodDef __pyx_methods_memoryview[] = {
22265  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22266  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22267  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22268  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22269  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22270  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22271  {0, 0, 0, 0}
22272 };
22273 
22274 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22275  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
22276  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
22277  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
22278  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
22279  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
22280  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
22281  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
22282  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
22283  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
22284  {0, 0, 0, 0, 0}
22285 };
22286 
22287 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22288  __pyx_memoryview___len__, /*sq_length*/
22289  0, /*sq_concat*/
22290  0, /*sq_repeat*/
22291  __pyx_sq_item_memoryview, /*sq_item*/
22292  0, /*sq_slice*/
22293  0, /*sq_ass_item*/
22294  0, /*sq_ass_slice*/
22295  0, /*sq_contains*/
22296  0, /*sq_inplace_concat*/
22297  0, /*sq_inplace_repeat*/
22298 };
22299 
22300 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22301  __pyx_memoryview___len__, /*mp_length*/
22302  __pyx_memoryview___getitem__, /*mp_subscript*/
22303  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
22304 };
22305 
22306 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22307  #if PY_MAJOR_VERSION < 3
22308  0, /*bf_getreadbuffer*/
22309  #endif
22310  #if PY_MAJOR_VERSION < 3
22311  0, /*bf_getwritebuffer*/
22312  #endif
22313  #if PY_MAJOR_VERSION < 3
22314  0, /*bf_getsegcount*/
22315  #endif
22316  #if PY_MAJOR_VERSION < 3
22317  0, /*bf_getcharbuffer*/
22318  #endif
22319  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
22320  0, /*bf_releasebuffer*/
22321 };
22322 
22323 static PyTypeObject __pyx_type___pyx_memoryview = {
22324  PyVarObject_HEAD_INIT(0, 0)
22325  "csmoothers.memoryview", /*tp_name*/
22326  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22327  0, /*tp_itemsize*/
22328  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22329  #if PY_VERSION_HEX < 0x030800b4
22330  0, /*tp_print*/
22331  #endif
22332  #if PY_VERSION_HEX >= 0x030800b4
22333  0, /*tp_vectorcall_offset*/
22334  #endif
22335  0, /*tp_getattr*/
22336  0, /*tp_setattr*/
22337  #if PY_MAJOR_VERSION < 3
22338  0, /*tp_compare*/
22339  #endif
22340  #if PY_MAJOR_VERSION >= 3
22341  0, /*tp_as_async*/
22342  #endif
22343  __pyx_memoryview___repr__, /*tp_repr*/
22344  0, /*tp_as_number*/
22345  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22346  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22347  0, /*tp_hash*/
22348  0, /*tp_call*/
22349  __pyx_memoryview___str__, /*tp_str*/
22350  0, /*tp_getattro*/
22351  0, /*tp_setattro*/
22352  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22353  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22354  0, /*tp_doc*/
22355  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22356  __pyx_tp_clear_memoryview, /*tp_clear*/
22357  0, /*tp_richcompare*/
22358  0, /*tp_weaklistoffset*/
22359  0, /*tp_iter*/
22360  0, /*tp_iternext*/
22361  __pyx_methods_memoryview, /*tp_methods*/
22362  0, /*tp_members*/
22363  __pyx_getsets_memoryview, /*tp_getset*/
22364  0, /*tp_base*/
22365  0, /*tp_dict*/
22366  0, /*tp_descr_get*/
22367  0, /*tp_descr_set*/
22368  0, /*tp_dictoffset*/
22369  0, /*tp_init*/
22370  0, /*tp_alloc*/
22371  __pyx_tp_new_memoryview, /*tp_new*/
22372  0, /*tp_free*/
22373  0, /*tp_is_gc*/
22374  0, /*tp_bases*/
22375  0, /*tp_mro*/
22376  0, /*tp_cache*/
22377  0, /*tp_subclasses*/
22378  0, /*tp_weaklist*/
22379  0, /*tp_del*/
22380  0, /*tp_version_tag*/
22381  #if PY_VERSION_HEX >= 0x030400a1
22382  0, /*tp_finalize*/
22383  #endif
22384  #if PY_VERSION_HEX >= 0x030800b1
22385  0, /*tp_vectorcall*/
22386  #endif
22387  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22388  0, /*tp_print*/
22389  #endif
22390 };
22391 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22392 
22393 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22394  struct __pyx_memoryviewslice_obj *p;
22395  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22396  if (unlikely(!o)) return 0;
22397  p = ((struct __pyx_memoryviewslice_obj *)o);
22398  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22399  p->from_object = Py_None; Py_INCREF(Py_None);
22400  p->from_slice.memview = NULL;
22401  return o;
22402 }
22403 
22404 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22405  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22406  #if CYTHON_USE_TP_FINALIZE
22407  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22408  if (PyObject_CallFinalizerFromDealloc(o)) return;
22409  }
22410  #endif
22411  PyObject_GC_UnTrack(o);
22412  {
22413  PyObject *etype, *eval, *etb;
22414  PyErr_Fetch(&etype, &eval, &etb);
22415  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22416  __pyx_memoryviewslice___dealloc__(o);
22417  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22418  PyErr_Restore(etype, eval, etb);
22419  }
22420  Py_CLEAR(p->from_object);
22421  PyObject_GC_Track(o);
22422  __pyx_tp_dealloc_memoryview(o);
22423 }
22424 
22425 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22426  int e;
22427  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22428  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22429  if (p->from_object) {
22430  e = (*v)(p->from_object, a); if (e) return e;
22431  }
22432  return 0;
22433 }
22434 
22435 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22436  PyObject* tmp;
22437  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22438  __pyx_tp_clear_memoryview(o);
22439  tmp = ((PyObject*)p->from_object);
22440  p->from_object = Py_None; Py_INCREF(Py_None);
22441  Py_XDECREF(tmp);
22442  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22443  return 0;
22444 }
22445 
22446 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22447  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22448 }
22449 
22450 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22451  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22452  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22453  {0, 0, 0, 0}
22454 };
22455 
22456 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22457  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22458  {0, 0, 0, 0, 0}
22459 };
22460 
22461 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22462  PyVarObject_HEAD_INIT(0, 0)
22463  "csmoothers._memoryviewslice", /*tp_name*/
22464  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22465  0, /*tp_itemsize*/
22466  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22467  #if PY_VERSION_HEX < 0x030800b4
22468  0, /*tp_print*/
22469  #endif
22470  #if PY_VERSION_HEX >= 0x030800b4
22471  0, /*tp_vectorcall_offset*/
22472  #endif
22473  0, /*tp_getattr*/
22474  0, /*tp_setattr*/
22475  #if PY_MAJOR_VERSION < 3
22476  0, /*tp_compare*/
22477  #endif
22478  #if PY_MAJOR_VERSION >= 3
22479  0, /*tp_as_async*/
22480  #endif
22481  #if CYTHON_COMPILING_IN_PYPY
22482  __pyx_memoryview___repr__, /*tp_repr*/
22483  #else
22484  0, /*tp_repr*/
22485  #endif
22486  0, /*tp_as_number*/
22487  0, /*tp_as_sequence*/
22488  0, /*tp_as_mapping*/
22489  0, /*tp_hash*/
22490  0, /*tp_call*/
22491  #if CYTHON_COMPILING_IN_PYPY
22492  __pyx_memoryview___str__, /*tp_str*/
22493  #else
22494  0, /*tp_str*/
22495  #endif
22496  0, /*tp_getattro*/
22497  0, /*tp_setattro*/
22498  0, /*tp_as_buffer*/
22499  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22500  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22501  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22502  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22503  0, /*tp_richcompare*/
22504  0, /*tp_weaklistoffset*/
22505  0, /*tp_iter*/
22506  0, /*tp_iternext*/
22507  __pyx_methods__memoryviewslice, /*tp_methods*/
22508  0, /*tp_members*/
22509  __pyx_getsets__memoryviewslice, /*tp_getset*/
22510  0, /*tp_base*/
22511  0, /*tp_dict*/
22512  0, /*tp_descr_get*/
22513  0, /*tp_descr_set*/
22514  0, /*tp_dictoffset*/
22515  0, /*tp_init*/
22516  0, /*tp_alloc*/
22517  __pyx_tp_new__memoryviewslice, /*tp_new*/
22518  0, /*tp_free*/
22519  0, /*tp_is_gc*/
22520  0, /*tp_bases*/
22521  0, /*tp_mro*/
22522  0, /*tp_cache*/
22523  0, /*tp_subclasses*/
22524  0, /*tp_weaklist*/
22525  0, /*tp_del*/
22526  0, /*tp_version_tag*/
22527  #if PY_VERSION_HEX >= 0x030400a1
22528  0, /*tp_finalize*/
22529  #endif
22530  #if PY_VERSION_HEX >= 0x030800b1
22531  0, /*tp_vectorcall*/
22532  #endif
22533  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22534  0, /*tp_print*/
22535  #endif
22536 };
22537 
22538 static PyMethodDef __pyx_methods[] = {
22539  {0, 0, 0, 0}
22540 };
22541 
22542 #if PY_MAJOR_VERSION >= 3
22543 #if CYTHON_PEP489_MULTI_PHASE_INIT
22544 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22545 static int __pyx_pymod_exec_csmoothers(PyObject* module); /*proto*/
22546 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22547  {Py_mod_create, (void*)__pyx_pymod_create},
22548  {Py_mod_exec, (void*)__pyx_pymod_exec_csmoothers},
22549  {0, NULL}
22550 };
22551 #endif
22552 
22553 static struct PyModuleDef __pyx_moduledef = {
22554  PyModuleDef_HEAD_INIT,
22555  "csmoothers",
22556  0, /* m_doc */
22557  #if CYTHON_PEP489_MULTI_PHASE_INIT
22558  0, /* m_size */
22559  #else
22560  -1, /* m_size */
22561  #endif
22562  __pyx_methods /* m_methods */,
22563  #if CYTHON_PEP489_MULTI_PHASE_INIT
22564  __pyx_moduledef_slots, /* m_slots */
22565  #else
22566  NULL, /* m_reload */
22567  #endif
22568  NULL, /* m_traverse */
22569  NULL, /* m_clear */
22570  NULL /* m_free */
22571 };
22572 #endif
22573 #ifndef CYTHON_SMALL_CODE
22574 #if defined(__clang__)
22575  #define CYTHON_SMALL_CODE
22576 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22577  #define CYTHON_SMALL_CODE __attribute__((cold))
22578 #else
22579  #define CYTHON_SMALL_CODE
22580 #endif
22581 #endif
22582 
22583 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22584  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
22585  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22586  {&__pyx_n_s_ASMFactor, __pyx_k_ASMFactor, sizeof(__pyx_k_ASMFactor), 0, 0, 1, 1},
22587  {&__pyx_n_s_ASMFactor___init, __pyx_k_ASMFactor___init, sizeof(__pyx_k_ASMFactor___init), 0, 0, 1, 1},
22588  {&__pyx_n_s_BASMFactor, __pyx_k_BASMFactor, sizeof(__pyx_k_BASMFactor), 0, 0, 1, 1},
22589  {&__pyx_n_s_BASMFactor___init, __pyx_k_BASMFactor___init, sizeof(__pyx_k_BASMFactor___init), 0, 0, 1, 1},
22590  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22591  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22592  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22593  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22594  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22595  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22596  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22597  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22598  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22599  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22600  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22601  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22602  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22603  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22604  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22605  {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
22606  {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1},
22607  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22608  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22609  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22610  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22611  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22612  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22613  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22614  {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1},
22615  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22616  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22617  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22618  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22619  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22620  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22621  {&__pyx_n_s_asmFactor, __pyx_k_asmFactor, sizeof(__pyx_k_asmFactor), 0, 0, 1, 1},
22622  {&__pyx_n_s_asm_NR_prepare, __pyx_k_asm_NR_prepare, sizeof(__pyx_k_asm_NR_prepare), 0, 0, 1, 1},
22623  {&__pyx_n_s_asm_NR_solve, __pyx_k_asm_NR_solve, sizeof(__pyx_k_asm_NR_solve), 0, 0, 1, 1},
22624  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22625  {&__pyx_n_s_basmFactor, __pyx_k_basmFactor, sizeof(__pyx_k_basmFactor), 0, 0, 1, 1},
22626  {&__pyx_n_s_basm_NR_prepare, __pyx_k_basm_NR_prepare, sizeof(__pyx_k_basm_NR_prepare), 0, 0, 1, 1},
22627  {&__pyx_n_s_basm_NR_solve, __pyx_k_basm_NR_solve, sizeof(__pyx_k_basm_NR_solve), 0, 0, 1, 1},
22628  {&__pyx_n_s_bs, __pyx_k_bs, sizeof(__pyx_k_bs), 0, 0, 1, 1},
22629  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22630  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22631  {&__pyx_n_s_cASMFactor, __pyx_k_cASMFactor, sizeof(__pyx_k_cASMFactor), 0, 0, 1, 1},
22632  {&__pyx_n_s_cASMFactor_2, __pyx_k_cASMFactor_2, sizeof(__pyx_k_cASMFactor_2), 0, 0, 1, 1},
22633  {&__pyx_n_s_cBASMFactor, __pyx_k_cBASMFactor, sizeof(__pyx_k_cBASMFactor), 0, 0, 1, 1},
22634  {&__pyx_n_s_cBASMFactor_2, __pyx_k_cBASMFactor_2, sizeof(__pyx_k_cBASMFactor_2), 0, 0, 1, 1},
22635  {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix, sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
22636  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22637  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22638  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22639  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22640  {&__pyx_n_s_csmoothers, __pyx_k_csmoothers, sizeof(__pyx_k_csmoothers), 0, 0, 1, 1},
22641  {&__pyx_n_s_dX, __pyx_k_dX, sizeof(__pyx_k_dX), 0, 0, 1, 1},
22642  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22643  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
22644  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22645  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22646  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22647  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22648  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22649  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22650  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22651  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22652  {&__pyx_n_s_gauss_seidel_NR_preare, __pyx_k_gauss_seidel_NR_preare, sizeof(__pyx_k_gauss_seidel_NR_preare), 0, 0, 1, 1},
22653  {&__pyx_n_s_gauss_seidel_NR_solve, __pyx_k_gauss_seidel_NR_solve, sizeof(__pyx_k_gauss_seidel_NR_solve), 0, 0, 1, 1},
22654  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22655  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22656  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22657  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22658  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
22659  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22660  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22661  {&__pyx_n_s_jacobi_NR_prepare, __pyx_k_jacobi_NR_prepare, sizeof(__pyx_k_jacobi_NR_prepare), 0, 0, 1, 1},
22662  {&__pyx_n_s_jacobi_NR_solve, __pyx_k_jacobi_NR_solve, sizeof(__pyx_k_jacobi_NR_solve), 0, 0, 1, 1},
22663  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22664  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22665  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
22666  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22667  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
22668  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22669  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22670  {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
22671  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22672  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22673  {&__pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_k_nl_gauss_seidel_NR_solve, sizeof(__pyx_k_nl_gauss_seidel_NR_solve), 0, 0, 1, 1},
22674  {&__pyx_n_s_nl_jacobi_NR_solve, __pyx_k_nl_jacobi_NR_solve, sizeof(__pyx_k_nl_jacobi_NR_solve), 0, 0, 1, 1},
22675  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22676  {&__pyx_n_s_node_order, __pyx_k_node_order, sizeof(__pyx_k_node_order), 0, 0, 1, 1},
22677  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
22678  {&__pyx_n_s_nr, __pyx_k_nr, sizeof(__pyx_k_nr), 0, 0, 1, 1},
22679  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22680  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22681  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22682  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22683  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
22684  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22685  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22686  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
22687  {&__pyx_kp_s_proteus_csmoothers_pyx, __pyx_k_proteus_csmoothers_pyx, sizeof(__pyx_k_proteus_csmoothers_pyx), 0, 0, 1, 0},
22688  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22689  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22690  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22691  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22692  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22693  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22694  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22695  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22696  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
22697  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22698  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22699  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22700  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22701  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
22702  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22703  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22704  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22705  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22706  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22707  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22708  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22709  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22710  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22711  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22712  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22713  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22714  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22715  {&__pyx_n_s_tol, __pyx_k_tol, sizeof(__pyx_k_tol), 0, 0, 1, 1},
22716  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22717  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22718  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22719  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22720  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22721  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
22722  {0, 0, 0, 0, 0, 0, 0}
22723 };
22724 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
22725  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 5, __pyx_L1_error)
22726  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22727  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 777, __pyx_L1_error)
22728  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 781, __pyx_L1_error)
22729  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 959, __pyx_L1_error)
22730  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
22731  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
22732  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
22733  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
22734  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
22735  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
22736  return 0;
22737  __pyx_L1_error:;
22738  return -1;
22739 }
22740 
22741 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
22742  __Pyx_RefNannyDeclarations
22743  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22744 
22745  /* "(tree fragment)":2
22746  * def __reduce_cython__(self):
22747  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22748  * def __setstate_cython__(self, __pyx_state):
22749  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22750  */
22751  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
22752  __Pyx_GOTREF(__pyx_tuple_);
22753  __Pyx_GIVEREF(__pyx_tuple_);
22754 
22755  /* "(tree fragment)":4
22756  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22757  * def __setstate_cython__(self, __pyx_state):
22758  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22759  */
22760  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
22761  __Pyx_GOTREF(__pyx_tuple__2);
22762  __Pyx_GIVEREF(__pyx_tuple__2);
22763 
22764  /* "(tree fragment)":2
22765  * def __reduce_cython__(self):
22766  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22767  * def __setstate_cython__(self, __pyx_state):
22768  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22769  */
22770  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
22771  __Pyx_GOTREF(__pyx_tuple__3);
22772  __Pyx_GIVEREF(__pyx_tuple__3);
22773 
22774  /* "(tree fragment)":4
22775  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22776  * def __setstate_cython__(self, __pyx_state):
22777  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22778  */
22779  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
22780  __Pyx_GOTREF(__pyx_tuple__4);
22781  __Pyx_GIVEREF(__pyx_tuple__4);
22782 
22783  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":777
22784  *
22785  * if (end - f) - <int>(new_offset - offset[0]) < 15:
22786  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
22787  *
22788  * if ((child.byteorder == c'>' and little_endian) or
22789  */
22790  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 777, __pyx_L1_error)
22791  __Pyx_GOTREF(__pyx_tuple__5);
22792  __Pyx_GIVEREF(__pyx_tuple__5);
22793 
22794  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":781
22795  * if ((child.byteorder == c'>' and little_endian) or
22796  * (child.byteorder == c'<' and not little_endian)):
22797  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
22798  * # One could encode it in the format string and have Cython
22799  * # complain instead, BUT: < and > in format strings also imply
22800  */
22801  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 781, __pyx_L1_error)
22802  __Pyx_GOTREF(__pyx_tuple__6);
22803  __Pyx_GIVEREF(__pyx_tuple__6);
22804 
22805  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":801
22806  * t = child.type_num
22807  * if end - f < 5:
22808  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
22809  *
22810  * # Until ticket #99 is fixed, use integers to avoid warnings
22811  */
22812  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 801, __pyx_L1_error)
22813  __Pyx_GOTREF(__pyx_tuple__7);
22814  __Pyx_GIVEREF(__pyx_tuple__7);
22815 
22816  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":959
22817  * __pyx_import_array()
22818  * except Exception:
22819  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
22820  *
22821  * cdef inline int import_umath() except -1:
22822  */
22823  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 959, __pyx_L1_error)
22824  __Pyx_GOTREF(__pyx_tuple__8);
22825  __Pyx_GIVEREF(__pyx_tuple__8);
22826 
22827  /* "../miniconda3/envs/proteus-dev-up/lib/python3.8/site-packages/numpy/__init__.pxd":965
22828  * _import_umath()
22829  * except Exception:
22830  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22831  *
22832  * cdef inline int import_ufunc() except -1:
22833  */
22834  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 965, __pyx_L1_error)
22835  __Pyx_GOTREF(__pyx_tuple__9);
22836  __Pyx_GIVEREF(__pyx_tuple__9);
22837 
22838  /* "View.MemoryView":133
22839  *
22840  * if not self.ndim:
22841  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22842  *
22843  * if itemsize <= 0:
22844  */
22845  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 133, __pyx_L1_error)
22846  __Pyx_GOTREF(__pyx_tuple__10);
22847  __Pyx_GIVEREF(__pyx_tuple__10);
22848 
22849  /* "View.MemoryView":136
22850  *
22851  * if itemsize <= 0:
22852  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22853  *
22854  * if not isinstance(format, bytes):
22855  */
22856  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 136, __pyx_L1_error)
22857  __Pyx_GOTREF(__pyx_tuple__11);
22858  __Pyx_GIVEREF(__pyx_tuple__11);
22859 
22860  /* "View.MemoryView":148
22861  *
22862  * if not self._shape:
22863  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22864  *
22865  *
22866  */
22867  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 148, __pyx_L1_error)
22868  __Pyx_GOTREF(__pyx_tuple__12);
22869  __Pyx_GIVEREF(__pyx_tuple__12);
22870 
22871  /* "View.MemoryView":176
22872  * self.data = <char *>malloc(self.len)
22873  * if not self.data:
22874  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22875  *
22876  * if self.dtype_is_object:
22877  */
22878  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 176, __pyx_L1_error)
22879  __Pyx_GOTREF(__pyx_tuple__13);
22880  __Pyx_GIVEREF(__pyx_tuple__13);
22881 
22882  /* "View.MemoryView":192
22883  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22884  * if not (flags & bufmode):
22885  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22886  * info.buf = self.data
22887  * info.len = self.len
22888  */
22889  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 192, __pyx_L1_error)
22890  __Pyx_GOTREF(__pyx_tuple__14);
22891  __Pyx_GIVEREF(__pyx_tuple__14);
22892 
22893  /* "(tree fragment)":2
22894  * def __reduce_cython__(self):
22895  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22896  * def __setstate_cython__(self, __pyx_state):
22897  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22898  */
22899  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
22900  __Pyx_GOTREF(__pyx_tuple__15);
22901  __Pyx_GIVEREF(__pyx_tuple__15);
22902 
22903  /* "(tree fragment)":4
22904  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22905  * def __setstate_cython__(self, __pyx_state):
22906  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22907  */
22908  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 4, __pyx_L1_error)
22909  __Pyx_GOTREF(__pyx_tuple__16);
22910  __Pyx_GIVEREF(__pyx_tuple__16);
22911 
22912  /* "View.MemoryView":418
22913  * def __setitem__(memoryview self, object index, object value):
22914  * if self.view.readonly:
22915  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22916  *
22917  * have_slices, index = _unellipsify(index, self.view.ndim)
22918  */
22919  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 418, __pyx_L1_error)
22920  __Pyx_GOTREF(__pyx_tuple__17);
22921  __Pyx_GIVEREF(__pyx_tuple__17);
22922 
22923  /* "View.MemoryView":495
22924  * result = struct.unpack(self.view.format, bytesitem)
22925  * except struct.error:
22926  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22927  * else:
22928  * if len(self.view.format) == 1:
22929  */
22930  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 495, __pyx_L1_error)
22931  __Pyx_GOTREF(__pyx_tuple__18);
22932  __Pyx_GIVEREF(__pyx_tuple__18);
22933 
22934  /* "View.MemoryView":520
22935  * def __getbuffer__(self, Py_buffer *info, int flags):
22936  * if flags & PyBUF_WRITABLE and self.view.readonly:
22937  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22938  *
22939  * if flags & PyBUF_ND:
22940  */
22941  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 520, __pyx_L1_error)
22942  __Pyx_GOTREF(__pyx_tuple__19);
22943  __Pyx_GIVEREF(__pyx_tuple__19);
22944 
22945  /* "View.MemoryView":570
22946  * if self.view.strides == NULL:
22947  *
22948  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22949  *
22950  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22951  */
22952  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 570, __pyx_L1_error)
22953  __Pyx_GOTREF(__pyx_tuple__20);
22954  __Pyx_GIVEREF(__pyx_tuple__20);
22955 
22956  /* "View.MemoryView":577
22957  * def suboffsets(self):
22958  * if self.view.suboffsets == NULL:
22959  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22960  *
22961  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22962  */
22963  __pyx_tuple__21 = PyTuple_New(1); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 577, __pyx_L1_error)
22964  __Pyx_GOTREF(__pyx_tuple__21);
22965  __Pyx_INCREF(__pyx_int_neg_1);
22966  __Pyx_GIVEREF(__pyx_int_neg_1);
22967  PyTuple_SET_ITEM(__pyx_tuple__21, 0, __pyx_int_neg_1);
22968  __Pyx_GIVEREF(__pyx_tuple__21);
22969 
22970  /* "(tree fragment)":2
22971  * def __reduce_cython__(self):
22972  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22973  * def __setstate_cython__(self, __pyx_state):
22974  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22975  */
22976  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 2, __pyx_L1_error)
22977  __Pyx_GOTREF(__pyx_tuple__22);
22978  __Pyx_GIVEREF(__pyx_tuple__22);
22979 
22980  /* "(tree fragment)":4
22981  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22982  * def __setstate_cython__(self, __pyx_state):
22983  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22984  */
22985  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 4, __pyx_L1_error)
22986  __Pyx_GOTREF(__pyx_tuple__23);
22987  __Pyx_GIVEREF(__pyx_tuple__23);
22988 
22989  /* "View.MemoryView":682
22990  * if item is Ellipsis:
22991  * if not seen_ellipsis:
22992  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22993  * seen_ellipsis = True
22994  * else:
22995  */
22996  __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(1, 682, __pyx_L1_error)
22997  __Pyx_GOTREF(__pyx_slice__24);
22998  __Pyx_GIVEREF(__pyx_slice__24);
22999 
23000  /* "View.MemoryView":703
23001  * for suboffset in suboffsets[:ndim]:
23002  * if suboffset >= 0:
23003  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
23004  *
23005  *
23006  */
23007  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 703, __pyx_L1_error)
23008  __Pyx_GOTREF(__pyx_tuple__25);
23009  __Pyx_GIVEREF(__pyx_tuple__25);
23010 
23011  /* "(tree fragment)":2
23012  * def __reduce_cython__(self):
23013  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23014  * def __setstate_cython__(self, __pyx_state):
23015  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23016  */
23017  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 2, __pyx_L1_error)
23018  __Pyx_GOTREF(__pyx_tuple__26);
23019  __Pyx_GIVEREF(__pyx_tuple__26);
23020 
23021  /* "(tree fragment)":4
23022  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23023  * def __setstate_cython__(self, __pyx_state):
23024  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23025  */
23026  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 4, __pyx_L1_error)
23027  __Pyx_GOTREF(__pyx_tuple__27);
23028  __Pyx_GIVEREF(__pyx_tuple__27);
23029 
23030  /* "csmoothers.pyx":5
23031  * cimport numpy as np
23032  *
23033  * class ASMFactor(object): # <<<<<<<<<<<<<<
23034  *
23035  * def __init__(self, L):
23036  */
23037  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 5, __pyx_L1_error)
23038  __Pyx_GOTREF(__pyx_tuple__28);
23039  __Pyx_GIVEREF(__pyx_tuple__28);
23040 
23041  /* "csmoothers.pyx":7
23042  * class ASMFactor(object):
23043  *
23044  * def __init__(self, L): # <<<<<<<<<<<<<<
23045  * self.L = L
23046  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
23047  */
23048  __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_L); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 7, __pyx_L1_error)
23049  __Pyx_GOTREF(__pyx_tuple__29);
23050  __Pyx_GIVEREF(__pyx_tuple__29);
23051  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 7, __pyx_L1_error)
23052 
23053  /* "csmoothers.pyx":42
23054  *
23055  *
23056  * class BASMFactor(object): # <<<<<<<<<<<<<<
23057  *
23058  * def __init__(self, L, bs):
23059  */
23060  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 42, __pyx_L1_error)
23061  __Pyx_GOTREF(__pyx_tuple__31);
23062  __Pyx_GIVEREF(__pyx_tuple__31);
23063 
23064  /* "csmoothers.pyx":44
23065  * class BASMFactor(object):
23066  *
23067  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
23068  * self.L = L
23069  * self.bs = bs
23070  */
23071  __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_L, __pyx_n_s_bs); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 44, __pyx_L1_error)
23072  __Pyx_GOTREF(__pyx_tuple__32);
23073  __Pyx_GIVEREF(__pyx_tuple__32);
23074  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 44, __pyx_L1_error)
23075 
23076  /* "csmoothers.pyx":84
23077  * self.subdomain_col_pivots)
23078  *
23079  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
23080  * """
23081  *
23082  */
23083  __pyx_tuple__34 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 84, __pyx_L1_error)
23084  __Pyx_GOTREF(__pyx_tuple__34);
23085  __Pyx_GIVEREF(__pyx_tuple__34);
23086  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_prepare, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 84, __pyx_L1_error)
23087 
23088  /* "csmoothers.pyx":109
23089  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
23090  *
23091  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23092  * """
23093  *
23094  */
23095  __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 109, __pyx_L1_error)
23096  __Pyx_GOTREF(__pyx_tuple__36);
23097  __Pyx_GIVEREF(__pyx_tuple__36);
23098  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_solve, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 109, __pyx_L1_error)
23099 
23100  /* "csmoothers.pyx":136
23101  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23102  *
23103  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23104  * """
23105  *
23106  */
23107  __pyx_tuple__38 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 136, __pyx_L1_error)
23108  __Pyx_GOTREF(__pyx_tuple__38);
23109  __Pyx_GIVEREF(__pyx_tuple__38);
23110  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_jacobi_NR_solve, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 136, __pyx_L1_error)
23111 
23112  /* "csmoothers.pyx":165
23113  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23114  *
23115  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
23116  * """
23117  *
23118  */
23119  __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 165, __pyx_L1_error)
23120  __Pyx_GOTREF(__pyx_tuple__40);
23121  __Pyx_GIVEREF(__pyx_tuple__40);
23122  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_preare, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 165, __pyx_L1_error)
23123 
23124  /* "csmoothers.pyx":190
23125  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
23126  *
23127  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23128  * """
23129  *
23130  */
23131  __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 190, __pyx_L1_error)
23132  __Pyx_GOTREF(__pyx_tuple__42);
23133  __Pyx_GIVEREF(__pyx_tuple__42);
23134  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_solve, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 190, __pyx_L1_error)
23135 
23136  /* "csmoothers.pyx":217
23137  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23138  *
23139  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23140  * """
23141  *
23142  */
23143  __pyx_tuple__44 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 217, __pyx_L1_error)
23144  __Pyx_GOTREF(__pyx_tuple__44);
23145  __Pyx_GIVEREF(__pyx_tuple__44);
23146  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_gauss_seidel_NR_solve, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 217, __pyx_L1_error)
23147 
23148  /* "csmoothers.pyx":251
23149  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23150  *
23151  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
23152  * """
23153  *
23154  */
23155  __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_asmFactor); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 251, __pyx_L1_error)
23156  __Pyx_GOTREF(__pyx_tuple__46);
23157  __Pyx_GIVEREF(__pyx_tuple__46);
23158  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_prepare, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 251, __pyx_L1_error)
23159 
23160  /* "csmoothers.pyx":277
23161  * asmFactor.subdomain_pivots)
23162  *
23163  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
23164  * """
23165  *
23166  */
23167  __pyx_tuple__48 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_asmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 277, __pyx_L1_error)
23168  __Pyx_GOTREF(__pyx_tuple__48);
23169  __Pyx_GIVEREF(__pyx_tuple__48);
23170  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_solve, 277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 277, __pyx_L1_error)
23171 
23172  /* "csmoothers.pyx":321
23173  * asmFactor.subdomain_pivots)
23174  *
23175  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
23176  * """
23177  *
23178  */
23179  __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_basmFactor); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 321, __pyx_L1_error)
23180  __Pyx_GOTREF(__pyx_tuple__50);
23181  __Pyx_GIVEREF(__pyx_tuple__50);
23182  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_prepare, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 321, __pyx_L1_error)
23183 
23184  /* "csmoothers.pyx":350
23185  *
23186  *
23187  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
23188  * """
23189  *
23190  */
23191  __pyx_tuple__52 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_basmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 350, __pyx_L1_error)
23192  __Pyx_GOTREF(__pyx_tuple__52);
23193  __Pyx_GIVEREF(__pyx_tuple__52);
23194  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_solve, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 350, __pyx_L1_error)
23195 
23196  /* "View.MemoryView":286
23197  * return self.name
23198  *
23199  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23200  * cdef strided = Enum("<strided and direct>") # default
23201  * cdef indirect = Enum("<strided and indirect>")
23202  */
23203  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 286, __pyx_L1_error)
23204  __Pyx_GOTREF(__pyx_tuple__54);
23205  __Pyx_GIVEREF(__pyx_tuple__54);
23206 
23207  /* "View.MemoryView":287
23208  *
23209  * cdef generic = Enum("<strided and direct or indirect>")
23210  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23211  * cdef indirect = Enum("<strided and indirect>")
23212  *
23213  */
23214  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 287, __pyx_L1_error)
23215  __Pyx_GOTREF(__pyx_tuple__55);
23216  __Pyx_GIVEREF(__pyx_tuple__55);
23217 
23218  /* "View.MemoryView":288
23219  * cdef generic = Enum("<strided and direct or indirect>")
23220  * cdef strided = Enum("<strided and direct>") # default
23221  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23222  *
23223  *
23224  */
23225  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 288, __pyx_L1_error)
23226  __Pyx_GOTREF(__pyx_tuple__56);
23227  __Pyx_GIVEREF(__pyx_tuple__56);
23228 
23229  /* "View.MemoryView":291
23230  *
23231  *
23232  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23233  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23234  *
23235  */
23236  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 291, __pyx_L1_error)
23237  __Pyx_GOTREF(__pyx_tuple__57);
23238  __Pyx_GIVEREF(__pyx_tuple__57);
23239 
23240  /* "View.MemoryView":292
23241  *
23242  * cdef contiguous = Enum("<contiguous and direct>")
23243  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23244  *
23245  *
23246  */
23247  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 292, __pyx_L1_error)
23248  __Pyx_GOTREF(__pyx_tuple__58);
23249  __Pyx_GIVEREF(__pyx_tuple__58);
23250 
23251  /* "(tree fragment)":1
23252  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23253  * cdef object __pyx_PickleError
23254  * cdef object __pyx_result
23255  */
23256  __pyx_tuple__59 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 1, __pyx_L1_error)
23257  __Pyx_GOTREF(__pyx_tuple__59);
23258  __Pyx_GIVEREF(__pyx_tuple__59);
23259  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 1, __pyx_L1_error)
23260  __Pyx_RefNannyFinishContext();
23261  return 0;
23262  __pyx_L1_error:;
23263  __Pyx_RefNannyFinishContext();
23264  return -1;
23265 }
23266 
23267 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
23268  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23269  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23270  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23271  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23272  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23273  return 0;
23274  __pyx_L1_error:;
23275  return -1;
23276 }
23277 
23278 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
23279 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
23280 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
23281 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
23282 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
23283 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
23284 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
23285 
23286 static int __Pyx_modinit_global_init_code(void) {
23287  __Pyx_RefNannyDeclarations
23288  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
23289  /*--- Global init code ---*/
23290  generic = Py_None; Py_INCREF(Py_None);
23291  strided = Py_None; Py_INCREF(Py_None);
23292  indirect = Py_None; Py_INCREF(Py_None);
23293  contiguous = Py_None; Py_INCREF(Py_None);
23294  indirect_contiguous = Py_None; Py_INCREF(Py_None);
23295  __Pyx_RefNannyFinishContext();
23296  return 0;
23297 }
23298 
23299 static int __Pyx_modinit_variable_export_code(void) {
23300  __Pyx_RefNannyDeclarations
23301  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
23302  /*--- Variable export code ---*/
23303  __Pyx_RefNannyFinishContext();
23304  return 0;
23305 }
23306 
23307 static int __Pyx_modinit_function_export_code(void) {
23308  __Pyx_RefNannyDeclarations
23309  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
23310  /*--- Function export code ---*/
23311  __Pyx_RefNannyFinishContext();
23312  return 0;
23313 }
23314 
23315 static int __Pyx_modinit_type_init_code(void) {
23316  __Pyx_RefNannyDeclarations
23317  int __pyx_lineno = 0;
23318  const char *__pyx_filename = NULL;
23319  int __pyx_clineno = 0;
23320  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
23321  /*--- Type init code ---*/
23322  if (PyType_Ready(&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23323  #if PY_VERSION_HEX < 0x030800B1
23324  __pyx_type_10csmoothers_cASMFactor.tp_print = 0;
23325  #endif
23326  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
23327  __pyx_type_10csmoothers_cASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23328  }
23329  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23330  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23331  __pyx_ptype_10csmoothers_cASMFactor = &__pyx_type_10csmoothers_cASMFactor;
23332  if (PyType_Ready(&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23333  #if PY_VERSION_HEX < 0x030800B1
23334  __pyx_type_10csmoothers_cBASMFactor.tp_print = 0;
23335  #endif
23336  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cBASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cBASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
23337  __pyx_type_10csmoothers_cBASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23338  }
23339  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cBASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23340  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23341  __pyx_ptype_10csmoothers_cBASMFactor = &__pyx_type_10csmoothers_cBASMFactor;
23342  __pyx_vtabptr_array = &__pyx_vtable_array;
23343  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
23344  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23345  #if PY_VERSION_HEX < 0x030800B1
23346  __pyx_type___pyx_array.tp_print = 0;
23347  #endif
23348  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23349  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23350  __pyx_array_type = &__pyx_type___pyx_array;
23351  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23352  #if PY_VERSION_HEX < 0x030800B1
23353  __pyx_type___pyx_MemviewEnum.tp_print = 0;
23354  #endif
23355  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23356  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23357  }
23358  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23359  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23360  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23361  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23362  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23363  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23364  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23365  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23366  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
23367  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23368  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23369  #if PY_VERSION_HEX < 0x030800B1
23370  __pyx_type___pyx_memoryview.tp_print = 0;
23371  #endif
23372  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23373  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23374  }
23375  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23376  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23377  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23378  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23379  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23380  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
23381  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23382  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23383  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23384  #if PY_VERSION_HEX < 0x030800B1
23385  __pyx_type___pyx_memoryviewslice.tp_print = 0;
23386  #endif
23387  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23388  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23389  }
23390  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23391  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23392  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23393  __Pyx_RefNannyFinishContext();
23394  return 0;
23395  __pyx_L1_error:;
23396  __Pyx_RefNannyFinishContext();
23397  return -1;
23398 }
23399 
23400 static int __Pyx_modinit_type_import_code(void) {
23401  __Pyx_RefNannyDeclarations
23402  PyObject *__pyx_t_1 = NULL;
23403  int __pyx_lineno = 0;
23404  const char *__pyx_filename = NULL;
23405  int __pyx_clineno = 0;
23406  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23407  /*--- Type import code ---*/
23408  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
23409  __Pyx_GOTREF(__pyx_t_1);
23410  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
23411  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23412  sizeof(PyTypeObject),
23413  #else
23414  sizeof(PyHeapTypeObject),
23415  #endif
23416  __Pyx_ImportType_CheckSize_Warn);
23417  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
23418  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23419  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __pyx_L1_error)
23420  __Pyx_GOTREF(__pyx_t_1);
23421  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23422  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 207, __pyx_L1_error)
23423  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23424  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 230, __pyx_L1_error)
23425  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23426  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 234, __pyx_L1_error)
23427  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23428  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 246, __pyx_L1_error)
23429  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23430  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 839, __pyx_L1_error)
23431  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23432  __pyx_t_1 = PyImport_ImportModule("proteus.superluWrappers"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 67, __pyx_L1_error)
23433  __Pyx_GOTREF(__pyx_t_1);
23434  __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = __Pyx_ImportType(__pyx_t_1, "proteus.superluWrappers", "cSparseMatrix", sizeof(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __Pyx_ImportType_CheckSize_Warn);
23435  if (!__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix) __PYX_ERR(4, 67, __pyx_L1_error)
23436  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23437  __Pyx_RefNannyFinishContext();
23438  return 0;
23439  __pyx_L1_error:;
23440  __Pyx_XDECREF(__pyx_t_1);
23441  __Pyx_RefNannyFinishContext();
23442  return -1;
23443 }
23444 
23445 static int __Pyx_modinit_variable_import_code(void) {
23446  __Pyx_RefNannyDeclarations
23447  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23448  /*--- Variable import code ---*/
23449  __Pyx_RefNannyFinishContext();
23450  return 0;
23451 }
23452 
23453 static int __Pyx_modinit_function_import_code(void) {
23454  __Pyx_RefNannyDeclarations
23455  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23456  /*--- Function import code ---*/
23457  __Pyx_RefNannyFinishContext();
23458  return 0;
23459 }
23460 
23461 
23462 #ifndef CYTHON_NO_PYINIT_EXPORT
23463 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23464 #elif PY_MAJOR_VERSION < 3
23465 #ifdef __cplusplus
23466 #define __Pyx_PyMODINIT_FUNC extern "C" void
23467 #else
23468 #define __Pyx_PyMODINIT_FUNC void
23469 #endif
23470 #else
23471 #ifdef __cplusplus
23472 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23473 #else
23474 #define __Pyx_PyMODINIT_FUNC PyObject *
23475 #endif
23476 #endif
23477 
23478 
23479 #if PY_MAJOR_VERSION < 3
23480 __Pyx_PyMODINIT_FUNC initcsmoothers(void) CYTHON_SMALL_CODE; /*proto*/
23481 __Pyx_PyMODINIT_FUNC initcsmoothers(void)
23482 #else
23483 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(void) CYTHON_SMALL_CODE; /*proto*/
23484 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)
23485 #if CYTHON_PEP489_MULTI_PHASE_INIT
23486 {
23487  return PyModuleDef_Init(&__pyx_moduledef);
23488 }
23489 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
23490  #if PY_VERSION_HEX >= 0x030700A1
23491  static PY_INT64_T main_interpreter_id = -1;
23492  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23493  if (main_interpreter_id == -1) {
23494  main_interpreter_id = current_id;
23495  return (unlikely(current_id == -1)) ? -1 : 0;
23496  } else if (unlikely(main_interpreter_id != current_id))
23497  #else
23498  static PyInterpreterState *main_interpreter = NULL;
23499  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23500  if (!main_interpreter) {
23501  main_interpreter = current_interpreter;
23502  } else if (unlikely(main_interpreter != current_interpreter))
23503  #endif
23504  {
23505  PyErr_SetString(
23506  PyExc_ImportError,
23507  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23508  return -1;
23509  }
23510  return 0;
23511 }
23512 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
23513  PyObject *value = PyObject_GetAttrString(spec, from_name);
23514  int result = 0;
23515  if (likely(value)) {
23516  if (allow_none || value != Py_None) {
23517  result = PyDict_SetItemString(moddict, to_name, value);
23518  }
23519  Py_DECREF(value);
23520  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23521  PyErr_Clear();
23522  } else {
23523  result = -1;
23524  }
23525  return result;
23526 }
23527 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23528  PyObject *module = NULL, *moddict, *modname;
23529  if (__Pyx_check_single_interpreter())
23530  return NULL;
23531  if (__pyx_m)
23532  return __Pyx_NewRef(__pyx_m);
23533  modname = PyObject_GetAttrString(spec, "name");
23534  if (unlikely(!modname)) goto bad;
23535  module = PyModule_NewObject(modname);
23536  Py_DECREF(modname);
23537  if (unlikely(!module)) goto bad;
23538  moddict = PyModule_GetDict(module);
23539  if (unlikely(!moddict)) goto bad;
23540  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
23541  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
23542  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
23543  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
23544  return module;
23545 bad:
23546  Py_XDECREF(module);
23547  return NULL;
23548 }
23549 
23550 
23551 static CYTHON_SMALL_CODE int __pyx_pymod_exec_csmoothers(PyObject *__pyx_pyinit_module)
23552 #endif
23553 #endif
23554 {
23555  PyObject *__pyx_t_1 = NULL;
23556  PyObject *__pyx_t_2 = NULL;
23557  PyObject *__pyx_t_3 = NULL;
23558  static PyThread_type_lock __pyx_t_4[8];
23559  int __pyx_lineno = 0;
23560  const char *__pyx_filename = NULL;
23561  int __pyx_clineno = 0;
23562  __Pyx_RefNannyDeclarations
23563  #if CYTHON_PEP489_MULTI_PHASE_INIT
23564  if (__pyx_m) {
23565  if (__pyx_m == __pyx_pyinit_module) return 0;
23566  PyErr_SetString(PyExc_RuntimeError, "Module 'csmoothers' has already been imported. Re-initialisation is not supported.");
23567  return -1;
23568  }
23569  #elif PY_MAJOR_VERSION >= 3
23570  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
23571  #endif
23572  #if CYTHON_REFNANNY
23573 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23574 if (!__Pyx_RefNanny) {
23575  PyErr_Clear();
23576  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23577  if (!__Pyx_RefNanny)
23578  Py_FatalError("failed to import 'refnanny' module");
23579 }
23580 #endif
23581  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)", 0);
23582  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23583  #ifdef __Pxy_PyFrame_Initialize_Offsets
23584  __Pxy_PyFrame_Initialize_Offsets();
23585  #endif
23586  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23587  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23588  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23589  #ifdef __Pyx_CyFunction_USED
23590  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23591  #endif
23592  #ifdef __Pyx_FusedFunction_USED
23593  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23594  #endif
23595  #ifdef __Pyx_Coroutine_USED
23596  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23597  #endif
23598  #ifdef __Pyx_Generator_USED
23599  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23600  #endif
23601  #ifdef __Pyx_AsyncGen_USED
23602  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23603  #endif
23604  #ifdef __Pyx_StopAsyncIteration_USED
23605  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23606  #endif
23607  /*--- Library function declarations ---*/
23608  /*--- Threads initialization code ---*/
23609  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23610  #ifdef WITH_THREAD /* Python build with threading support? */
23611  PyEval_InitThreads();
23612  #endif
23613  #endif
23614  /*--- Module creation code ---*/
23615  #if CYTHON_PEP489_MULTI_PHASE_INIT
23616  __pyx_m = __pyx_pyinit_module;
23617  Py_INCREF(__pyx_m);
23618  #else
23619  #if PY_MAJOR_VERSION < 3
23620  __pyx_m = Py_InitModule4("csmoothers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23621  #else
23622  __pyx_m = PyModule_Create(&__pyx_moduledef);
23623  #endif
23624  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23625  #endif
23626  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23627  Py_INCREF(__pyx_d);
23628  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23629  Py_INCREF(__pyx_b);
23630  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23631  Py_INCREF(__pyx_cython_runtime);
23632  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23633  /*--- Initialize various global constants etc. ---*/
23634  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23635  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23636  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23637  #endif
23638  if (__pyx_module_is_main_csmoothers) {
23639  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23640  }
23641  #if PY_MAJOR_VERSION >= 3
23642  {
23643  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23644  if (!PyDict_GetItemString(modules, "csmoothers")) {
23645  if (unlikely(PyDict_SetItemString(modules, "csmoothers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23646  }
23647  }
23648  #endif
23649  /*--- Builtin init code ---*/
23650  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23651  /*--- Constants init code ---*/
23652  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23653  /*--- Global type/function init code ---*/
23654  (void)__Pyx_modinit_global_init_code();
23655  (void)__Pyx_modinit_variable_export_code();
23656  (void)__Pyx_modinit_function_export_code();
23657  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23658  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23659  (void)__Pyx_modinit_variable_import_code();
23660  (void)__Pyx_modinit_function_import_code();
23661  /*--- Execution code ---*/
23662  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23663  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23664  #endif
23665 
23666  /* "csmoothers.pyx":1
23667  * import numpy as np # <<<<<<<<<<<<<<
23668  * import cython
23669  * cimport numpy as np
23670  */
23671  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23672  __Pyx_GOTREF(__pyx_t_1);
23673  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23674  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23675 
23676  /* "csmoothers.pyx":5
23677  * cimport numpy as np
23678  *
23679  * class ASMFactor(object): # <<<<<<<<<<<<<<
23680  *
23681  * def __init__(self, L):
23682  */
23683  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__28); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
23684  __Pyx_GOTREF(__pyx_t_1);
23685  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__28, __pyx_n_s_ASMFactor, __pyx_n_s_ASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
23686  __Pyx_GOTREF(__pyx_t_2);
23687 
23688  /* "csmoothers.pyx":7
23689  * class ASMFactor(object):
23690  *
23691  * def __init__(self, L): # <<<<<<<<<<<<<<
23692  * self.L = L
23693  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
23694  */
23695  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_9ASMFactor_1__init__, 0, __pyx_n_s_ASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
23696  __Pyx_GOTREF(__pyx_t_3);
23697  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
23698  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23699 
23700  /* "csmoothers.pyx":5
23701  * cimport numpy as np
23702  *
23703  * class ASMFactor(object): # <<<<<<<<<<<<<<
23704  *
23705  * def __init__(self, L):
23706  */
23707  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ASMFactor, __pyx_tuple__28, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
23708  __Pyx_GOTREF(__pyx_t_3);
23709  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
23710  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23711  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23712  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23713 
23714  /* "csmoothers.pyx":42
23715  *
23716  *
23717  * class BASMFactor(object): # <<<<<<<<<<<<<<
23718  *
23719  * def __init__(self, L, bs):
23720  */
23721  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__31); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
23722  __Pyx_GOTREF(__pyx_t_1);
23723  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__31, __pyx_n_s_BASMFactor, __pyx_n_s_BASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
23724  __Pyx_GOTREF(__pyx_t_2);
23725 
23726  /* "csmoothers.pyx":44
23727  * class BASMFactor(object):
23728  *
23729  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
23730  * self.L = L
23731  * self.bs = bs
23732  */
23733  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_10BASMFactor_1__init__, 0, __pyx_n_s_BASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
23734  __Pyx_GOTREF(__pyx_t_3);
23735  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
23736  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23737 
23738  /* "csmoothers.pyx":42
23739  *
23740  *
23741  * class BASMFactor(object): # <<<<<<<<<<<<<<
23742  *
23743  * def __init__(self, L, bs):
23744  */
23745  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BASMFactor, __pyx_tuple__31, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
23746  __Pyx_GOTREF(__pyx_t_3);
23747  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
23748  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23749  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23750  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23751 
23752  /* "csmoothers.pyx":84
23753  * self.subdomain_col_pivots)
23754  *
23755  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
23756  * """
23757  *
23758  */
23759  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_1jacobi_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
23760  __Pyx_GOTREF(__pyx_t_1);
23761  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
23762  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23763 
23764  /* "csmoothers.pyx":109
23765  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
23766  *
23767  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23768  * """
23769  *
23770  */
23771  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_3jacobi_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
23772  __Pyx_GOTREF(__pyx_t_1);
23773  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
23774  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23775 
23776  /* "csmoothers.pyx":136
23777  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23778  *
23779  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23780  * """
23781  *
23782  */
23783  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_5nl_jacobi_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
23784  __Pyx_GOTREF(__pyx_t_1);
23785  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
23786  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23787 
23788  /* "csmoothers.pyx":165
23789  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23790  *
23791  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
23792  * """
23793  *
23794  */
23795  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_7gauss_seidel_NR_preare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
23796  __Pyx_GOTREF(__pyx_t_1);
23797  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_preare, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
23798  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23799 
23800  /* "csmoothers.pyx":190
23801  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
23802  *
23803  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23804  * """
23805  *
23806  */
23807  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_9gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
23808  __Pyx_GOTREF(__pyx_t_1);
23809  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
23810  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23811 
23812  /* "csmoothers.pyx":217
23813  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23814  *
23815  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23816  * """
23817  *
23818  */
23819  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
23820  __Pyx_GOTREF(__pyx_t_1);
23821  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
23822  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23823 
23824  /* "csmoothers.pyx":251
23825  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23826  *
23827  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
23828  * """
23829  *
23830  */
23831  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_13asm_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
23832  __Pyx_GOTREF(__pyx_t_1);
23833  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
23834  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23835 
23836  /* "csmoothers.pyx":277
23837  * asmFactor.subdomain_pivots)
23838  *
23839  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
23840  * """
23841  *
23842  */
23843  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_15asm_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
23844  __Pyx_GOTREF(__pyx_t_1);
23845  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
23846  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23847 
23848  /* "csmoothers.pyx":321
23849  * asmFactor.subdomain_pivots)
23850  *
23851  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
23852  * """
23853  *
23854  */
23855  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_17basm_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
23856  __Pyx_GOTREF(__pyx_t_1);
23857  if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
23858  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23859 
23860  /* "csmoothers.pyx":350
23861  *
23862  *
23863  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
23864  * """
23865  *
23866  */
23867  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_19basm_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
23868  __Pyx_GOTREF(__pyx_t_1);
23869  if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
23870  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23871 
23872  /* "csmoothers.pyx":1
23873  * import numpy as np # <<<<<<<<<<<<<<
23874  * import cython
23875  * cimport numpy as np
23876  */
23877  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23878  __Pyx_GOTREF(__pyx_t_1);
23879  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23880  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23881 
23882  /* "View.MemoryView":209
23883  * info.obj = self
23884  *
23885  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23886  *
23887  * def __dealloc__(array self):
23888  */
23889  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
23890  __Pyx_GOTREF(__pyx_t_1);
23891  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
23892  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23893  PyType_Modified(__pyx_array_type);
23894 
23895  /* "View.MemoryView":286
23896  * return self.name
23897  *
23898  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23899  * cdef strided = Enum("<strided and direct>") # default
23900  * cdef indirect = Enum("<strided and indirect>")
23901  */
23902  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23903  __Pyx_GOTREF(__pyx_t_1);
23904  __Pyx_XGOTREF(generic);
23905  __Pyx_DECREF_SET(generic, __pyx_t_1);
23906  __Pyx_GIVEREF(__pyx_t_1);
23907  __pyx_t_1 = 0;
23908 
23909  /* "View.MemoryView":287
23910  *
23911  * cdef generic = Enum("<strided and direct or indirect>")
23912  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23913  * cdef indirect = Enum("<strided and indirect>")
23914  *
23915  */
23916  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23917  __Pyx_GOTREF(__pyx_t_1);
23918  __Pyx_XGOTREF(strided);
23919  __Pyx_DECREF_SET(strided, __pyx_t_1);
23920  __Pyx_GIVEREF(__pyx_t_1);
23921  __pyx_t_1 = 0;
23922 
23923  /* "View.MemoryView":288
23924  * cdef generic = Enum("<strided and direct or indirect>")
23925  * cdef strided = Enum("<strided and direct>") # default
23926  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23927  *
23928  *
23929  */
23930  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
23931  __Pyx_GOTREF(__pyx_t_1);
23932  __Pyx_XGOTREF(indirect);
23933  __Pyx_DECREF_SET(indirect, __pyx_t_1);
23934  __Pyx_GIVEREF(__pyx_t_1);
23935  __pyx_t_1 = 0;
23936 
23937  /* "View.MemoryView":291
23938  *
23939  *
23940  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23941  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23942  *
23943  */
23944  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23945  __Pyx_GOTREF(__pyx_t_1);
23946  __Pyx_XGOTREF(contiguous);
23947  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23948  __Pyx_GIVEREF(__pyx_t_1);
23949  __pyx_t_1 = 0;
23950 
23951  /* "View.MemoryView":292
23952  *
23953  * cdef contiguous = Enum("<contiguous and direct>")
23954  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23955  *
23956  *
23957  */
23958  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
23959  __Pyx_GOTREF(__pyx_t_1);
23960  __Pyx_XGOTREF(indirect_contiguous);
23961  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23962  __Pyx_GIVEREF(__pyx_t_1);
23963  __pyx_t_1 = 0;
23964 
23965  /* "View.MemoryView":316
23966  *
23967  * DEF THREAD_LOCKS_PREALLOCATED = 8
23968  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23969  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23970  * PyThread_allocate_lock(),
23971  */
23972  __pyx_memoryview_thread_locks_used = 0;
23973 
23974  /* "View.MemoryView":317
23975  * DEF THREAD_LOCKS_PREALLOCATED = 8
23976  * cdef int __pyx_memoryview_thread_locks_used = 0
23977  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23978  * PyThread_allocate_lock(),
23979  * PyThread_allocate_lock(),
23980  */
23981  __pyx_t_4[0] = PyThread_allocate_lock();
23982  __pyx_t_4[1] = PyThread_allocate_lock();
23983  __pyx_t_4[2] = PyThread_allocate_lock();
23984  __pyx_t_4[3] = PyThread_allocate_lock();
23985  __pyx_t_4[4] = PyThread_allocate_lock();
23986  __pyx_t_4[5] = PyThread_allocate_lock();
23987  __pyx_t_4[6] = PyThread_allocate_lock();
23988  __pyx_t_4[7] = PyThread_allocate_lock();
23989  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23990 
23991  /* "View.MemoryView":549
23992  * info.obj = self
23993  *
23994  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23995  *
23996  *
23997  */
23998  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
23999  __Pyx_GOTREF(__pyx_t_1);
24000  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
24001  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24002  PyType_Modified(__pyx_memoryview_type);
24003 
24004  /* "View.MemoryView":995
24005  * return self.from_object
24006  *
24007  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24008  *
24009  *
24010  */
24011  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
24012  __Pyx_GOTREF(__pyx_t_1);
24013  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
24014  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24015  PyType_Modified(__pyx_memoryviewslice_type);
24016 
24017  /* "(tree fragment)":1
24018  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
24019  * cdef object __pyx_PickleError
24020  * cdef object __pyx_result
24021  */
24022  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24023  __Pyx_GOTREF(__pyx_t_1);
24024  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24025  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24026 
24027  /* "(tree fragment)":11
24028  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
24029  * return __pyx_result
24030  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
24031  * __pyx_result.name = __pyx_state[0]
24032  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
24033  */
24034 
24035  /*--- Wrapped vars code ---*/
24036 
24037  goto __pyx_L0;
24038  __pyx_L1_error:;
24039  __Pyx_XDECREF(__pyx_t_1);
24040  __Pyx_XDECREF(__pyx_t_2);
24041  __Pyx_XDECREF(__pyx_t_3);
24042  if (__pyx_m) {
24043  if (__pyx_d) {
24044  __Pyx_AddTraceback("init csmoothers", __pyx_clineno, __pyx_lineno, __pyx_filename);
24045  }
24046  Py_CLEAR(__pyx_m);
24047  } else if (!PyErr_Occurred()) {
24048  PyErr_SetString(PyExc_ImportError, "init csmoothers");
24049  }
24050  __pyx_L0:;
24051  __Pyx_RefNannyFinishContext();
24052  #if CYTHON_PEP489_MULTI_PHASE_INIT
24053  return (__pyx_m != NULL) ? 0 : -1;
24054  #elif PY_MAJOR_VERSION >= 3
24055  return __pyx_m;
24056  #else
24057  return;
24058  #endif
24059 }
24060 
24061 /* --- Runtime support code --- */
24062 /* Refnanny */
24063 #if CYTHON_REFNANNY
24064 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
24065  PyObject *m = NULL, *p = NULL;
24066  void *r = NULL;
24067  m = PyImport_ImportModule(modname);
24068  if (!m) goto end;
24069  p = PyObject_GetAttrString(m, "RefNannyAPI");
24070  if (!p) goto end;
24071  r = PyLong_AsVoidPtr(p);
24072 end:
24073  Py_XDECREF(p);
24074  Py_XDECREF(m);
24075  return (__Pyx_RefNannyAPIStruct *)r;
24076 }
24077 #endif
24078 
24079 /* PyObjectGetAttrStr */
24080 #if CYTHON_USE_TYPE_SLOTS
24081 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24082  PyTypeObject* tp = Py_TYPE(obj);
24083  if (likely(tp->tp_getattro))
24084  return tp->tp_getattro(obj, attr_name);
24085 #if PY_MAJOR_VERSION < 3
24086  if (likely(tp->tp_getattr))
24087  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24088 #endif
24089  return PyObject_GetAttr(obj, attr_name);
24090 }
24091 #endif
24092 
24093 /* GetBuiltinName */
24094 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24095  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24096  if (unlikely(!result)) {
24097  PyErr_Format(PyExc_NameError,
24098 #if PY_MAJOR_VERSION >= 3
24099  "name '%U' is not defined", name);
24100 #else
24101  "name '%.200s' is not defined", PyString_AS_STRING(name));
24102 #endif
24103  }
24104  return result;
24105 }
24106 
24107 /* RaiseArgTupleInvalid */
24108 static void __Pyx_RaiseArgtupleInvalid(
24109  const char* func_name,
24110  int exact,
24111  Py_ssize_t num_min,
24112  Py_ssize_t num_max,
24113  Py_ssize_t num_found)
24114 {
24115  Py_ssize_t num_expected;
24116  const char *more_or_less;
24117  if (num_found < num_min) {
24118  num_expected = num_min;
24119  more_or_less = "at least";
24120  } else {
24121  num_expected = num_max;
24122  more_or_less = "at most";
24123  }
24124  if (exact) {
24125  more_or_less = "exactly";
24126  }
24127  PyErr_Format(PyExc_TypeError,
24128  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
24129  func_name, more_or_less, num_expected,
24130  (num_expected == 1) ? "" : "s", num_found);
24131 }
24132 
24133 /* RaiseDoubleKeywords */
24134 static void __Pyx_RaiseDoubleKeywordsError(
24135  const char* func_name,
24136  PyObject* kw_name)
24137 {
24138  PyErr_Format(PyExc_TypeError,
24139  #if PY_MAJOR_VERSION >= 3
24140  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24141  #else
24142  "%s() got multiple values for keyword argument '%s'", func_name,
24143  PyString_AsString(kw_name));
24144  #endif
24145 }
24146 
24147 /* ParseKeywords */
24148 static int __Pyx_ParseOptionalKeywords(
24149  PyObject *kwds,
24150  PyObject **argnames[],
24151  PyObject *kwds2,
24152  PyObject *values[],
24153  Py_ssize_t num_pos_args,
24154  const char* function_name)
24155 {
24156  PyObject *key = 0, *value = 0;
24157  Py_ssize_t pos = 0;
24158  PyObject*** name;
24159  PyObject*** first_kw_arg = argnames + num_pos_args;
24160  while (PyDict_Next(kwds, &pos, &key, &value)) {
24161  name = first_kw_arg;
24162  while (*name && (**name != key)) name++;
24163  if (*name) {
24164  values[name-argnames] = value;
24165  continue;
24166  }
24167  name = first_kw_arg;
24168  #if PY_MAJOR_VERSION < 3
24169  if (likely(PyString_Check(key))) {
24170  while (*name) {
24171  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24172  && _PyString_Eq(**name, key)) {
24173  values[name-argnames] = value;
24174  break;
24175  }
24176  name++;
24177  }
24178  if (*name) continue;
24179  else {
24180  PyObject*** argname = argnames;
24181  while (argname != first_kw_arg) {
24182  if ((**argname == key) || (
24183  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24184  && _PyString_Eq(**argname, key))) {
24185  goto arg_passed_twice;
24186  }
24187  argname++;
24188  }
24189  }
24190  } else
24191  #endif
24192  if (likely(PyUnicode_Check(key))) {
24193  while (*name) {
24194  int cmp = (**name == key) ? 0 :
24195  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24196  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24197  #endif
24198  PyUnicode_Compare(**name, key);
24199  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24200  if (cmp == 0) {
24201  values[name-argnames] = value;
24202  break;
24203  }
24204  name++;
24205  }
24206  if (*name) continue;
24207  else {
24208  PyObject*** argname = argnames;
24209  while (argname != first_kw_arg) {
24210  int cmp = (**argname == key) ? 0 :
24211  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24212  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24213  #endif
24214  PyUnicode_Compare(**argname, key);
24215  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24216  if (cmp == 0) goto arg_passed_twice;
24217  argname++;
24218  }
24219  }
24220  } else
24221  goto invalid_keyword_type;
24222  if (kwds2) {
24223  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
24224  } else {
24225  goto invalid_keyword;
24226  }
24227  }
24228  return 0;
24229 arg_passed_twice:
24230  __Pyx_RaiseDoubleKeywordsError(function_name, key);
24231  goto bad;
24232 invalid_keyword_type:
24233  PyErr_Format(PyExc_TypeError,
24234  "%.200s() keywords must be strings", function_name);
24235  goto bad;
24236 invalid_keyword:
24237  PyErr_Format(PyExc_TypeError,
24238  #if PY_MAJOR_VERSION < 3
24239  "%.200s() got an unexpected keyword argument '%.200s'",
24240  function_name, PyString_AsString(key));
24241  #else
24242  "%s() got an unexpected keyword argument '%U'",
24243  function_name, key);
24244  #endif
24245 bad:
24246  return -1;
24247 }
24248 
24249 /* PyObjectSetAttrStr */
24250 #if CYTHON_USE_TYPE_SLOTS
24251 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
24252  PyTypeObject* tp = Py_TYPE(obj);
24253  if (likely(tp->tp_setattro))
24254  return tp->tp_setattro(obj, attr_name, value);
24255 #if PY_MAJOR_VERSION < 3
24256  if (likely(tp->tp_setattr))
24257  return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
24258 #endif
24259  return PyObject_SetAttr(obj, attr_name, value);
24260 }
24261 #endif
24262 
24263 /* PyCFunctionFastCall */
24264 #if CYTHON_FAST_PYCCALL
24265 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24266  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24267  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24268  PyObject *self = PyCFunction_GET_SELF(func);
24269  int flags = PyCFunction_GET_FLAGS(func);
24270  assert(PyCFunction_Check(func));
24271  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24272  assert(nargs >= 0);
24273  assert(nargs == 0 || args != NULL);
24274  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24275  because it may clear it (directly or indirectly) and so the
24276  caller loses its exception */
24277  assert(!PyErr_Occurred());
24278  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24279  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24280  } else {
24281  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24282  }
24283 }
24284 #endif
24285 
24286 /* PyFunctionFastCall */
24287 #if CYTHON_FAST_PYCALL
24288 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24289  PyObject *globals) {
24290  PyFrameObject *f;
24291  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24292  PyObject **fastlocals;
24293  Py_ssize_t i;
24294  PyObject *result;
24295  assert(globals != NULL);
24296  /* XXX Perhaps we should create a specialized
24297  PyFrame_New() that doesn't take locals, but does
24298  take builtins without sanity checking them.
24299  */
24300  assert(tstate != NULL);
24301  f = PyFrame_New(tstate, co, globals, NULL);
24302  if (f == NULL) {
24303  return NULL;
24304  }
24305  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24306  for (i = 0; i < na; i++) {
24307  Py_INCREF(*args);
24308  fastlocals[i] = *args++;
24309  }
24310  result = PyEval_EvalFrameEx(f,0);
24311  ++tstate->recursion_depth;
24312  Py_DECREF(f);
24313  --tstate->recursion_depth;
24314  return result;
24315 }
24316 #if 1 || PY_VERSION_HEX < 0x030600B1
24317 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24318  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24319  PyObject *globals = PyFunction_GET_GLOBALS(func);
24320  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24321  PyObject *closure;
24322 #if PY_MAJOR_VERSION >= 3
24323  PyObject *kwdefs;
24324 #endif
24325  PyObject *kwtuple, **k;
24326  PyObject **d;
24327  Py_ssize_t nd;
24328  Py_ssize_t nk;
24329  PyObject *result;
24330  assert(kwargs == NULL || PyDict_Check(kwargs));
24331  nk = kwargs ? PyDict_Size(kwargs) : 0;
24332  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24333  return NULL;
24334  }
24335  if (
24336 #if PY_MAJOR_VERSION >= 3
24337  co->co_kwonlyargcount == 0 &&
24338 #endif
24339  likely(kwargs == NULL || nk == 0) &&
24340  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24341  if (argdefs == NULL && co->co_argcount == nargs) {
24342  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24343  goto done;
24344  }
24345  else if (nargs == 0 && argdefs != NULL
24346  && co->co_argcount == Py_SIZE(argdefs)) {
24347  /* function called with no arguments, but all parameters have
24348  a default value: use default values as arguments .*/
24349  args = &PyTuple_GET_ITEM(argdefs, 0);
24350  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24351  goto done;
24352  }
24353  }
24354  if (kwargs != NULL) {
24355  Py_ssize_t pos, i;
24356  kwtuple = PyTuple_New(2 * nk);
24357  if (kwtuple == NULL) {
24358  result = NULL;
24359  goto done;
24360  }
24361  k = &PyTuple_GET_ITEM(kwtuple, 0);
24362  pos = i = 0;
24363  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24364  Py_INCREF(k[i]);
24365  Py_INCREF(k[i+1]);
24366  i += 2;
24367  }
24368  nk = i / 2;
24369  }
24370  else {
24371  kwtuple = NULL;
24372  k = NULL;
24373  }
24374  closure = PyFunction_GET_CLOSURE(func);
24375 #if PY_MAJOR_VERSION >= 3
24376  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24377 #endif
24378  if (argdefs != NULL) {
24379  d = &PyTuple_GET_ITEM(argdefs, 0);
24380  nd = Py_SIZE(argdefs);
24381  }
24382  else {
24383  d = NULL;
24384  nd = 0;
24385  }
24386 #if PY_MAJOR_VERSION >= 3
24387  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24388  args, (int)nargs,
24389  k, (int)nk,
24390  d, (int)nd, kwdefs, closure);
24391 #else
24392  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24393  args, (int)nargs,
24394  k, (int)nk,
24395  d, (int)nd, closure);
24396 #endif
24397  Py_XDECREF(kwtuple);
24398 done:
24399  Py_LeaveRecursiveCall();
24400  return result;
24401 }
24402 #endif
24403 #endif
24404 
24405 /* PyObjectCall */
24406 #if CYTHON_COMPILING_IN_CPYTHON
24407 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24408  PyObject *result;
24409  ternaryfunc call = func->ob_type->tp_call;
24410  if (unlikely(!call))
24411  return PyObject_Call(func, arg, kw);
24412  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24413  return NULL;
24414  result = (*call)(func, arg, kw);
24415  Py_LeaveRecursiveCall();
24416  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24417  PyErr_SetString(
24418  PyExc_SystemError,
24419  "NULL result without error in PyObject_Call");
24420  }
24421  return result;
24422 }
24423 #endif
24424 
24425 /* PyObjectCallMethO */
24426 #if CYTHON_COMPILING_IN_CPYTHON
24427 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24428  PyObject *self, *result;
24429  PyCFunction cfunc;
24430  cfunc = PyCFunction_GET_FUNCTION(func);
24431  self = PyCFunction_GET_SELF(func);
24432  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24433  return NULL;
24434  result = cfunc(self, arg);
24435  Py_LeaveRecursiveCall();
24436  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24437  PyErr_SetString(
24438  PyExc_SystemError,
24439  "NULL result without error in PyObject_Call");
24440  }
24441  return result;
24442 }
24443 #endif
24444 
24445 /* PyObjectCallOneArg */
24446 #if CYTHON_COMPILING_IN_CPYTHON
24447 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24448  PyObject *result;
24449  PyObject *args = PyTuple_New(1);
24450  if (unlikely(!args)) return NULL;
24451  Py_INCREF(arg);
24452  PyTuple_SET_ITEM(args, 0, arg);
24453  result = __Pyx_PyObject_Call(func, args, NULL);
24454  Py_DECREF(args);
24455  return result;
24456 }
24457 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24458 #if CYTHON_FAST_PYCALL
24459  if (PyFunction_Check(func)) {
24460  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24461  }
24462 #endif
24463  if (likely(PyCFunction_Check(func))) {
24464  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24465  return __Pyx_PyObject_CallMethO(func, arg);
24466 #if CYTHON_FAST_PYCCALL
24467  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24468  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24469 #endif
24470  }
24471  }
24472  return __Pyx__PyObject_CallOneArg(func, arg);
24473 }
24474 #else
24475 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24476  PyObject *result;
24477  PyObject *args = PyTuple_Pack(1, arg);
24478  if (unlikely(!args)) return NULL;
24479  result = __Pyx_PyObject_Call(func, args, NULL);
24480  Py_DECREF(args);
24481  return result;
24482 }
24483 #endif
24484 
24485 /* ArgTypeTest */
24486 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
24487 {
24488  if (unlikely(!type)) {
24489  PyErr_SetString(PyExc_SystemError, "Missing type object");
24490  return 0;
24491  }
24492  else if (exact) {
24493  #if PY_MAJOR_VERSION == 2
24494  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
24495  #endif
24496  }
24497  else {
24498  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
24499  }
24500  PyErr_Format(PyExc_TypeError,
24501  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24502  name, type->tp_name, Py_TYPE(obj)->tp_name);
24503  return 0;
24504 }
24505 
24506 /* PyErrFetchRestore */
24507 #if CYTHON_FAST_THREAD_STATE
24508 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24509  PyObject *tmp_type, *tmp_value, *tmp_tb;
24510  tmp_type = tstate->curexc_type;
24511  tmp_value = tstate->curexc_value;
24512  tmp_tb = tstate->curexc_traceback;
24513  tstate->curexc_type = type;
24514  tstate->curexc_value = value;
24515  tstate->curexc_traceback = tb;
24516  Py_XDECREF(tmp_type);
24517  Py_XDECREF(tmp_value);
24518  Py_XDECREF(tmp_tb);
24519 }
24520 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24521  *type = tstate->curexc_type;
24522  *value = tstate->curexc_value;
24523  *tb = tstate->curexc_traceback;
24524  tstate->curexc_type = 0;
24525  tstate->curexc_value = 0;
24526  tstate->curexc_traceback = 0;
24527 }
24528 #endif
24529 
24530 /* RaiseException */
24531 #if PY_MAJOR_VERSION < 3
24532 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24533  CYTHON_UNUSED PyObject *cause) {
24534  __Pyx_PyThreadState_declare
24535  Py_XINCREF(type);
24536  if (!value || value == Py_None)
24537  value = NULL;
24538  else
24539  Py_INCREF(value);
24540  if (!tb || tb == Py_None)
24541  tb = NULL;
24542  else {
24543  Py_INCREF(tb);
24544  if (!PyTraceBack_Check(tb)) {
24545  PyErr_SetString(PyExc_TypeError,
24546  "raise: arg 3 must be a traceback or None");
24547  goto raise_error;
24548  }
24549  }
24550  if (PyType_Check(type)) {
24551 #if CYTHON_COMPILING_IN_PYPY
24552  if (!value) {
24553  Py_INCREF(Py_None);
24554  value = Py_None;
24555  }
24556 #endif
24557  PyErr_NormalizeException(&type, &value, &tb);
24558  } else {
24559  if (value) {
24560  PyErr_SetString(PyExc_TypeError,
24561  "instance exception may not have a separate value");
24562  goto raise_error;
24563  }
24564  value = type;
24565  type = (PyObject*) Py_TYPE(type);
24566  Py_INCREF(type);
24567  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24568  PyErr_SetString(PyExc_TypeError,
24569  "raise: exception class must be a subclass of BaseException");
24570  goto raise_error;
24571  }
24572  }
24573  __Pyx_PyThreadState_assign
24574  __Pyx_ErrRestore(type, value, tb);
24575  return;
24576 raise_error:
24577  Py_XDECREF(value);
24578  Py_XDECREF(type);
24579  Py_XDECREF(tb);
24580  return;
24581 }
24582 #else
24583 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24584  PyObject* owned_instance = NULL;
24585  if (tb == Py_None) {
24586  tb = 0;
24587  } else if (tb && !PyTraceBack_Check(tb)) {
24588  PyErr_SetString(PyExc_TypeError,
24589  "raise: arg 3 must be a traceback or None");
24590  goto bad;
24591  }
24592  if (value == Py_None)
24593  value = 0;
24594  if (PyExceptionInstance_Check(type)) {
24595  if (value) {
24596  PyErr_SetString(PyExc_TypeError,
24597  "instance exception may not have a separate value");
24598  goto bad;
24599  }
24600  value = type;
24601  type = (PyObject*) Py_TYPE(value);
24602  } else if (PyExceptionClass_Check(type)) {
24603  PyObject *instance_class = NULL;
24604  if (value && PyExceptionInstance_Check(value)) {
24605  instance_class = (PyObject*) Py_TYPE(value);
24606  if (instance_class != type) {
24607  int is_subclass = PyObject_IsSubclass(instance_class, type);
24608  if (!is_subclass) {
24609  instance_class = NULL;
24610  } else if (unlikely(is_subclass == -1)) {
24611  goto bad;
24612  } else {
24613  type = instance_class;
24614  }
24615  }
24616  }
24617  if (!instance_class) {
24618  PyObject *args;
24619  if (!value)
24620  args = PyTuple_New(0);
24621  else if (PyTuple_Check(value)) {
24622  Py_INCREF(value);
24623  args = value;
24624  } else
24625  args = PyTuple_Pack(1, value);
24626  if (!args)
24627  goto bad;
24628  owned_instance = PyObject_Call(type, args, NULL);
24629  Py_DECREF(args);
24630  if (!owned_instance)
24631  goto bad;
24632  value = owned_instance;
24633  if (!PyExceptionInstance_Check(value)) {
24634  PyErr_Format(PyExc_TypeError,
24635  "calling %R should have returned an instance of "
24636  "BaseException, not %R",
24637  type, Py_TYPE(value));
24638  goto bad;
24639  }
24640  }
24641  } else {
24642  PyErr_SetString(PyExc_TypeError,
24643  "raise: exception class must be a subclass of BaseException");
24644  goto bad;
24645  }
24646  if (cause) {
24647  PyObject *fixed_cause;
24648  if (cause == Py_None) {
24649  fixed_cause = NULL;
24650  } else if (PyExceptionClass_Check(cause)) {
24651  fixed_cause = PyObject_CallObject(cause, NULL);
24652  if (fixed_cause == NULL)
24653  goto bad;
24654  } else if (PyExceptionInstance_Check(cause)) {
24655  fixed_cause = cause;
24656  Py_INCREF(fixed_cause);
24657  } else {
24658  PyErr_SetString(PyExc_TypeError,
24659  "exception causes must derive from "
24660  "BaseException");
24661  goto bad;
24662  }
24663  PyException_SetCause(value, fixed_cause);
24664  }
24665  PyErr_SetObject(type, value);
24666  if (tb) {
24667 #if CYTHON_COMPILING_IN_PYPY
24668  PyObject *tmp_type, *tmp_value, *tmp_tb;
24669  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24670  Py_INCREF(tb);
24671  PyErr_Restore(tmp_type, tmp_value, tb);
24672  Py_XDECREF(tmp_tb);
24673 #else
24674  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24675  PyObject* tmp_tb = tstate->curexc_traceback;
24676  if (tb != tmp_tb) {
24677  Py_INCREF(tb);
24678  tstate->curexc_traceback = tb;
24679  Py_XDECREF(tmp_tb);
24680  }
24681 #endif
24682  }
24683 bad:
24684  Py_XDECREF(owned_instance);
24685  return;
24686 }
24687 #endif
24688 
24689 /* ExtTypeTest */
24690 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24691  if (unlikely(!type)) {
24692  PyErr_SetString(PyExc_SystemError, "Missing type object");
24693  return 0;
24694  }
24695  if (likely(__Pyx_TypeCheck(obj, type)))
24696  return 1;
24697  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
24698  Py_TYPE(obj)->tp_name, type->tp_name);
24699  return 0;
24700 }
24701 
24702 /* MemviewSliceInit */
24703 static int
24704 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
24705  int ndim,
24706  __Pyx_memviewslice *memviewslice,
24707  int memview_is_new_reference)
24708 {
24709  __Pyx_RefNannyDeclarations
24710  int i, retval=-1;
24711  Py_buffer *buf = &memview->view;
24712  __Pyx_RefNannySetupContext("init_memviewslice", 0);
24713  if (unlikely(memviewslice->memview || memviewslice->data)) {
24714  PyErr_SetString(PyExc_ValueError,
24715  "memviewslice is already initialized!");
24716  goto fail;
24717  }
24718  if (buf->strides) {
24719  for (i = 0; i < ndim; i++) {
24720  memviewslice->strides[i] = buf->strides[i];
24721  }
24722  } else {
24723  Py_ssize_t stride = buf->itemsize;
24724  for (i = ndim - 1; i >= 0; i--) {
24725  memviewslice->strides[i] = stride;
24726  stride *= buf->shape[i];
24727  }
24728  }
24729  for (i = 0; i < ndim; i++) {
24730  memviewslice->shape[i] = buf->shape[i];
24731  if (buf->suboffsets) {
24732  memviewslice->suboffsets[i] = buf->suboffsets[i];
24733  } else {
24734  memviewslice->suboffsets[i] = -1;
24735  }
24736  }
24737  memviewslice->memview = memview;
24738  memviewslice->data = (char *)buf->buf;
24739  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24740  Py_INCREF(memview);
24741  }
24742  retval = 0;
24743  goto no_fail;
24744 fail:
24745  memviewslice->memview = 0;
24746  memviewslice->data = 0;
24747  retval = -1;
24748 no_fail:
24749  __Pyx_RefNannyFinishContext();
24750  return retval;
24751 }
24752 #ifndef Py_NO_RETURN
24753 #define Py_NO_RETURN
24754 #endif
24755 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
24756  va_list vargs;
24757  char msg[200];
24758 #ifdef HAVE_STDARG_PROTOTYPES
24759  va_start(vargs, fmt);
24760 #else
24761  va_start(vargs);
24762 #endif
24763  vsnprintf(msg, 200, fmt, vargs);
24764  va_end(vargs);
24765  Py_FatalError(msg);
24766 }
24767 static CYTHON_INLINE int
24768 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24769  PyThread_type_lock lock)
24770 {
24771  int result;
24772  PyThread_acquire_lock(lock, 1);
24773  result = (*acquisition_count)++;
24774  PyThread_release_lock(lock);
24775  return result;
24776 }
24777 static CYTHON_INLINE int
24778 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24779  PyThread_type_lock lock)
24780 {
24781  int result;
24782  PyThread_acquire_lock(lock, 1);
24783  result = (*acquisition_count)--;
24784  PyThread_release_lock(lock);
24785  return result;
24786 }
24787 static CYTHON_INLINE void
24788 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
24789 {
24790  int first_time;
24791  struct __pyx_memoryview_obj *memview = memslice->memview;
24792  if (unlikely(!memview || (PyObject *) memview == Py_None))
24793  return;
24794  if (unlikely(__pyx_get_slice_count(memview) < 0))
24795  __pyx_fatalerror("Acquisition count is %d (line %d)",
24796  __pyx_get_slice_count(memview), lineno);
24797  first_time = __pyx_add_acquisition_count(memview) == 0;
24798  if (unlikely(first_time)) {
24799  if (have_gil) {
24800  Py_INCREF((PyObject *) memview);
24801  } else {
24802  PyGILState_STATE _gilstate = PyGILState_Ensure();
24803  Py_INCREF((PyObject *) memview);
24804  PyGILState_Release(_gilstate);
24805  }
24806  }
24807 }
24808 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24809  int have_gil, int lineno) {
24810  int last_time;
24811  struct __pyx_memoryview_obj *memview = memslice->memview;
24812  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24813  memslice->memview = NULL;
24814  return;
24815  }
24816  if (unlikely(__pyx_get_slice_count(memview) <= 0))
24817  __pyx_fatalerror("Acquisition count is %d (line %d)",
24818  __pyx_get_slice_count(memview), lineno);
24819  last_time = __pyx_sub_acquisition_count(memview) == 1;
24820  memslice->data = NULL;
24821  if (unlikely(last_time)) {
24822  if (have_gil) {
24823  Py_CLEAR(memslice->memview);
24824  } else {
24825  PyGILState_STATE _gilstate = PyGILState_Ensure();
24826  Py_CLEAR(memslice->memview);
24827  PyGILState_Release(_gilstate);
24828  }
24829  } else {
24830  memslice->memview = NULL;
24831  }
24832 }
24833 
24834 /* BufferIndexError */
24835 static void __Pyx_RaiseBufferIndexError(int axis) {
24836  PyErr_Format(PyExc_IndexError,
24837  "Out of bounds on buffer access (axis %d)", axis);
24838 }
24839 
24840 /* WriteUnraisableException */
24841 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
24842  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
24843  int full_traceback, CYTHON_UNUSED int nogil) {
24844  PyObject *old_exc, *old_val, *old_tb;
24845  PyObject *ctx;
24846  __Pyx_PyThreadState_declare
24847 #ifdef WITH_THREAD
24848  PyGILState_STATE state;
24849  if (nogil)
24850  state = PyGILState_Ensure();
24851 #ifdef _MSC_VER
24852  else state = (PyGILState_STATE)-1;
24853 #endif
24854 #endif
24855  __Pyx_PyThreadState_assign
24856  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24857  if (full_traceback) {
24858  Py_XINCREF(old_exc);
24859  Py_XINCREF(old_val);
24860  Py_XINCREF(old_tb);
24861  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24862  PyErr_PrintEx(1);
24863  }
24864  #if PY_MAJOR_VERSION < 3
24865  ctx = PyString_FromString(name);
24866  #else
24867  ctx = PyUnicode_FromString(name);
24868  #endif
24869  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24870  if (!ctx) {
24871  PyErr_WriteUnraisable(Py_None);
24872  } else {
24873  PyErr_WriteUnraisable(ctx);
24874  Py_DECREF(ctx);
24875  }
24876 #ifdef WITH_THREAD
24877  if (nogil)
24878  PyGILState_Release(state);
24879 #endif
24880 }
24881 
24882 /* DictGetItem */
24883 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24884 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24885  PyObject *value;
24886  value = PyDict_GetItemWithError(d, key);
24887  if (unlikely(!value)) {
24888  if (!PyErr_Occurred()) {
24889  if (unlikely(PyTuple_Check(key))) {
24890  PyObject* args = PyTuple_Pack(1, key);
24891  if (likely(args)) {
24892  PyErr_SetObject(PyExc_KeyError, args);
24893  Py_DECREF(args);
24894  }
24895  } else {
24896  PyErr_SetObject(PyExc_KeyError, key);
24897  }
24898  }
24899  return NULL;
24900  }
24901  Py_INCREF(value);
24902  return value;
24903 }
24904 #endif
24905 
24906 /* RaiseTooManyValuesToUnpack */
24907 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24908  PyErr_Format(PyExc_ValueError,
24909  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
24910 }
24911 
24912 /* RaiseNeedMoreValuesToUnpack */
24913 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24914  PyErr_Format(PyExc_ValueError,
24915  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
24916  index, (index == 1) ? "" : "s");
24917 }
24918 
24919 /* RaiseNoneIterError */
24920 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
24921  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
24922 }
24923 
24924 /* GetTopmostException */
24925 #if CYTHON_USE_EXC_INFO_STACK
24926 static _PyErr_StackItem *
24927 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24928 {
24929  _PyErr_StackItem *exc_info = tstate->exc_info;
24930  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24931  exc_info->previous_item != NULL)
24932  {
24933  exc_info = exc_info->previous_item;
24934  }
24935  return exc_info;
24936 }
24937 #endif
24938 
24939 /* SaveResetException */
24940 #if CYTHON_FAST_THREAD_STATE
24941 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24942  #if CYTHON_USE_EXC_INFO_STACK
24943  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24944  *type = exc_info->exc_type;
24945  *value = exc_info->exc_value;
24946  *tb = exc_info->exc_traceback;
24947  #else
24948  *type = tstate->exc_type;
24949  *value = tstate->exc_value;
24950  *tb = tstate->exc_traceback;
24951  #endif
24952  Py_XINCREF(*type);
24953  Py_XINCREF(*value);
24954  Py_XINCREF(*tb);
24955 }
24956 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24957  PyObject *tmp_type, *tmp_value, *tmp_tb;
24958  #if CYTHON_USE_EXC_INFO_STACK
24959  _PyErr_StackItem *exc_info = tstate->exc_info;
24960  tmp_type = exc_info->exc_type;
24961  tmp_value = exc_info->exc_value;
24962  tmp_tb = exc_info->exc_traceback;
24963  exc_info->exc_type = type;
24964  exc_info->exc_value = value;
24965  exc_info->exc_traceback = tb;
24966  #else
24967  tmp_type = tstate->exc_type;
24968  tmp_value = tstate->exc_value;
24969  tmp_tb = tstate->exc_traceback;
24970  tstate->exc_type = type;
24971  tstate->exc_value = value;
24972  tstate->exc_traceback = tb;
24973  #endif
24974  Py_XDECREF(tmp_type);
24975  Py_XDECREF(tmp_value);
24976  Py_XDECREF(tmp_tb);
24977 }
24978 #endif
24979 
24980 /* PyErrExceptionMatches */
24981 #if CYTHON_FAST_THREAD_STATE
24982 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24983  Py_ssize_t i, n;
24984  n = PyTuple_GET_SIZE(tuple);
24985 #if PY_MAJOR_VERSION >= 3
24986  for (i=0; i<n; i++) {
24987  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24988  }
24989 #endif
24990  for (i=0; i<n; i++) {
24991  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24992  }
24993  return 0;
24994 }
24995 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24996  PyObject *exc_type = tstate->curexc_type;
24997  if (exc_type == err) return 1;
24998  if (unlikely(!exc_type)) return 0;
24999  if (unlikely(PyTuple_Check(err)))
25000  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25001  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25002 }
25003 #endif
25004 
25005 /* GetException */
25006 #if CYTHON_FAST_THREAD_STATE
25007 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25008 #else
25009 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25010 #endif
25011 {
25012  PyObject *local_type, *local_value, *local_tb;
25013 #if CYTHON_FAST_THREAD_STATE
25014  PyObject *tmp_type, *tmp_value, *tmp_tb;
25015  local_type = tstate->curexc_type;
25016  local_value = tstate->curexc_value;
25017  local_tb = tstate->curexc_traceback;
25018  tstate->curexc_type = 0;
25019  tstate->curexc_value = 0;
25020  tstate->curexc_traceback = 0;
25021 #else
25022  PyErr_Fetch(&local_type, &local_value, &local_tb);
25023 #endif
25024  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25025 #if CYTHON_FAST_THREAD_STATE
25026  if (unlikely(tstate->curexc_type))
25027 #else
25028  if (unlikely(PyErr_Occurred()))
25029 #endif
25030  goto bad;
25031  #if PY_MAJOR_VERSION >= 3
25032  if (local_tb) {
25033  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25034  goto bad;
25035  }
25036  #endif
25037  Py_XINCREF(local_tb);
25038  Py_XINCREF(local_type);
25039  Py_XINCREF(local_value);
25040  *type = local_type;
25041  *value = local_value;
25042  *tb = local_tb;
25043 #if CYTHON_FAST_THREAD_STATE
25044  #if CYTHON_USE_EXC_INFO_STACK
25045  {
25046  _PyErr_StackItem *exc_info = tstate->exc_info;
25047  tmp_type = exc_info->exc_type;
25048  tmp_value = exc_info->exc_value;
25049  tmp_tb = exc_info->exc_traceback;
25050  exc_info->exc_type = local_type;
25051  exc_info->exc_value = local_value;
25052  exc_info->exc_traceback = local_tb;
25053  }
25054  #else
25055  tmp_type = tstate->exc_type;
25056  tmp_value = tstate->exc_value;
25057  tmp_tb = tstate->exc_traceback;
25058  tstate->exc_type = local_type;
25059  tstate->exc_value = local_value;
25060  tstate->exc_traceback = local_tb;
25061  #endif
25062  Py_XDECREF(tmp_type);
25063  Py_XDECREF(tmp_value);
25064  Py_XDECREF(tmp_tb);
25065 #else
25066  PyErr_SetExcInfo(local_type, local_value, local_tb);
25067 #endif
25068  return 0;
25069 bad:
25070  *type = 0;
25071  *value = 0;
25072  *tb = 0;
25073  Py_XDECREF(local_type);
25074  Py_XDECREF(local_value);
25075  Py_XDECREF(local_tb);
25076  return -1;
25077 }
25078 
25079 /* PyObjectCall2Args */
25080 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
25081  PyObject *args, *result = NULL;
25082  #if CYTHON_FAST_PYCALL
25083  if (PyFunction_Check(function)) {
25084  PyObject *args[2] = {arg1, arg2};
25085  return __Pyx_PyFunction_FastCall(function, args, 2);
25086  }
25087  #endif
25088  #if CYTHON_FAST_PYCCALL
25089  if (__Pyx_PyFastCFunction_Check(function)) {
25090  PyObject *args[2] = {arg1, arg2};
25091  return __Pyx_PyCFunction_FastCall(function, args, 2);
25092  }
25093  #endif
25094  args = PyTuple_New(2);
25095  if (unlikely(!args)) goto done;
25096  Py_INCREF(arg1);
25097  PyTuple_SET_ITEM(args, 0, arg1);
25098  Py_INCREF(arg2);
25099  PyTuple_SET_ITEM(args, 1, arg2);
25100  Py_INCREF(function);
25101  result = __Pyx_PyObject_Call(function, args, NULL);
25102  Py_DECREF(args);
25103  Py_DECREF(function);
25104 done:
25105  return result;
25106 }
25107 
25108 /* BytesEquals */
25109 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
25110 #if CYTHON_COMPILING_IN_PYPY
25111  return PyObject_RichCompareBool(s1, s2, equals);
25112 #else
25113  if (s1 == s2) {
25114  return (equals == Py_EQ);
25115  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
25116  const char *ps1, *ps2;
25117  Py_ssize_t length = PyBytes_GET_SIZE(s1);
25118  if (length != PyBytes_GET_SIZE(s2))
25119  return (equals == Py_NE);
25120  ps1 = PyBytes_AS_STRING(s1);
25121  ps2 = PyBytes_AS_STRING(s2);
25122  if (ps1[0] != ps2[0]) {
25123  return (equals == Py_NE);
25124  } else if (length == 1) {
25125  return (equals == Py_EQ);
25126  } else {
25127  int result;
25128 #if CYTHON_USE_UNICODE_INTERNALS
25129  Py_hash_t hash1, hash2;
25130  hash1 = ((PyBytesObject*)s1)->ob_shash;
25131  hash2 = ((PyBytesObject*)s2)->ob_shash;
25132  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25133  return (equals == Py_NE);
25134  }
25135 #endif
25136  result = memcmp(ps1, ps2, (size_t)length);
25137  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25138  }
25139  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25140  return (equals == Py_NE);
25141  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25142  return (equals == Py_NE);
25143  } else {
25144  int result;
25145  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25146  if (!py_result)
25147  return -1;
25148  result = __Pyx_PyObject_IsTrue(py_result);
25149  Py_DECREF(py_result);
25150  return result;
25151  }
25152 #endif
25153 }
25154 
25155 /* UnicodeEquals */
25156 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
25157 #if CYTHON_COMPILING_IN_PYPY
25158  return PyObject_RichCompareBool(s1, s2, equals);
25159 #else
25160 #if PY_MAJOR_VERSION < 3
25161  PyObject* owned_ref = NULL;
25162 #endif
25163  int s1_is_unicode, s2_is_unicode;
25164  if (s1 == s2) {
25165  goto return_eq;
25166  }
25167  s1_is_unicode = PyUnicode_CheckExact(s1);
25168  s2_is_unicode = PyUnicode_CheckExact(s2);
25169 #if PY_MAJOR_VERSION < 3
25170  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25171  owned_ref = PyUnicode_FromObject(s2);
25172  if (unlikely(!owned_ref))
25173  return -1;
25174  s2 = owned_ref;
25175  s2_is_unicode = 1;
25176  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25177  owned_ref = PyUnicode_FromObject(s1);
25178  if (unlikely(!owned_ref))
25179  return -1;
25180  s1 = owned_ref;
25181  s1_is_unicode = 1;
25182  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25183  return __Pyx_PyBytes_Equals(s1, s2, equals);
25184  }
25185 #endif
25186  if (s1_is_unicode & s2_is_unicode) {
25187  Py_ssize_t length;
25188  int kind;
25189  void *data1, *data2;
25190  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25191  return -1;
25192  length = __Pyx_PyUnicode_GET_LENGTH(s1);
25193  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25194  goto return_ne;
25195  }
25196 #if CYTHON_USE_UNICODE_INTERNALS
25197  {
25198  Py_hash_t hash1, hash2;
25199  #if CYTHON_PEP393_ENABLED
25200  hash1 = ((PyASCIIObject*)s1)->hash;
25201  hash2 = ((PyASCIIObject*)s2)->hash;
25202  #else
25203  hash1 = ((PyUnicodeObject*)s1)->hash;
25204  hash2 = ((PyUnicodeObject*)s2)->hash;
25205  #endif
25206  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25207  goto return_ne;
25208  }
25209  }
25210 #endif
25211  kind = __Pyx_PyUnicode_KIND(s1);
25212  if (kind != __Pyx_PyUnicode_KIND(s2)) {
25213  goto return_ne;
25214  }
25215  data1 = __Pyx_PyUnicode_DATA(s1);
25216  data2 = __Pyx_PyUnicode_DATA(s2);
25217  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25218  goto return_ne;
25219  } else if (length == 1) {
25220  goto return_eq;
25221  } else {
25222  int result = memcmp(data1, data2, (size_t)(length * kind));
25223  #if PY_MAJOR_VERSION < 3
25224  Py_XDECREF(owned_ref);
25225  #endif
25226  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25227  }
25228  } else if ((s1 == Py_None) & s2_is_unicode) {
25229  goto return_ne;
25230  } else if ((s2 == Py_None) & s1_is_unicode) {
25231  goto return_ne;
25232  } else {
25233  int result;
25234  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25235  #if PY_MAJOR_VERSION < 3
25236  Py_XDECREF(owned_ref);
25237  #endif
25238  if (!py_result)
25239  return -1;
25240  result = __Pyx_PyObject_IsTrue(py_result);
25241  Py_DECREF(py_result);
25242  return result;
25243  }
25244 return_eq:
25245  #if PY_MAJOR_VERSION < 3
25246  Py_XDECREF(owned_ref);
25247  #endif
25248  return (equals == Py_EQ);
25249 return_ne:
25250  #if PY_MAJOR_VERSION < 3
25251  Py_XDECREF(owned_ref);
25252  #endif
25253  return (equals == Py_NE);
25254 #endif
25255 }
25256 
25257 /* None */
25258 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25259  Py_ssize_t q = a / b;
25260  Py_ssize_t r = a - q*b;
25261  q -= ((r != 0) & ((r ^ b) < 0));
25262  return q;
25263 }
25264 
25265 /* GetAttr */
25266 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25267 #if CYTHON_USE_TYPE_SLOTS
25268 #if PY_MAJOR_VERSION >= 3
25269  if (likely(PyUnicode_Check(n)))
25270 #else
25271  if (likely(PyString_Check(n)))
25272 #endif
25273  return __Pyx_PyObject_GetAttrStr(o, n);
25274 #endif
25275  return PyObject_GetAttr(o, n);
25276 }
25277 
25278 /* GetItemInt */
25279 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25280  PyObject *r;
25281  if (!j) return NULL;
25282  r = PyObject_GetItem(o, j);
25283  Py_DECREF(j);
25284  return r;
25285 }
25286 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25287  CYTHON_NCP_UNUSED int wraparound,
25288  CYTHON_NCP_UNUSED int boundscheck) {
25289 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25290  Py_ssize_t wrapped_i = i;
25291  if (wraparound & unlikely(i < 0)) {
25292  wrapped_i += PyList_GET_SIZE(o);
25293  }
25294  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
25295  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
25296  Py_INCREF(r);
25297  return r;
25298  }
25299  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25300 #else
25301  return PySequence_GetItem(o, i);
25302 #endif
25303 }
25304 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25305  CYTHON_NCP_UNUSED int wraparound,
25306  CYTHON_NCP_UNUSED int boundscheck) {
25307 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25308  Py_ssize_t wrapped_i = i;
25309  if (wraparound & unlikely(i < 0)) {
25310  wrapped_i += PyTuple_GET_SIZE(o);
25311  }
25312  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
25313  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
25314  Py_INCREF(r);
25315  return r;
25316  }
25317  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25318 #else
25319  return PySequence_GetItem(o, i);
25320 #endif
25321 }
25322 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
25323  CYTHON_NCP_UNUSED int wraparound,
25324  CYTHON_NCP_UNUSED int boundscheck) {
25325 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
25326  if (is_list || PyList_CheckExact(o)) {
25327  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25328  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
25329  PyObject *r = PyList_GET_ITEM(o, n);
25330  Py_INCREF(r);
25331  return r;
25332  }
25333  }
25334  else if (PyTuple_CheckExact(o)) {
25335  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25336  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
25337  PyObject *r = PyTuple_GET_ITEM(o, n);
25338  Py_INCREF(r);
25339  return r;
25340  }
25341  } else {
25342  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25343  if (likely(m && m->sq_item)) {
25344  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25345  Py_ssize_t l = m->sq_length(o);
25346  if (likely(l >= 0)) {
25347  i += l;
25348  } else {
25349  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25350  return NULL;
25351  PyErr_Clear();
25352  }
25353  }
25354  return m->sq_item(o, i);
25355  }
25356  }
25357 #else
25358  if (is_list || PySequence_Check(o)) {
25359  return PySequence_GetItem(o, i);
25360  }
25361 #endif
25362  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25363 }
25364 
25365 /* ObjectGetItem */
25366 #if CYTHON_USE_TYPE_SLOTS
25367 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25368  PyObject *runerr;
25369  Py_ssize_t key_value;
25370  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25371  if (unlikely(!(m && m->sq_item))) {
25372  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25373  return NULL;
25374  }
25375  key_value = __Pyx_PyIndex_AsSsize_t(index);
25376  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25377  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25378  }
25379  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25380  PyErr_Clear();
25381  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25382  }
25383  return NULL;
25384 }
25385 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25386  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25387  if (likely(m && m->mp_subscript)) {
25388  return m->mp_subscript(obj, key);
25389  }
25390  return __Pyx_PyObject_GetIndex(obj, key);
25391 }
25392 #endif
25393 
25394 /* decode_c_string */
25395 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25396  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25397  const char* encoding, const char* errors,
25398  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
25399  Py_ssize_t length;
25400  if (unlikely((start < 0) | (stop < 0))) {
25401  size_t slen = strlen(cstring);
25402  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
25403  PyErr_SetString(PyExc_OverflowError,
25404  "c-string too long to convert to Python");
25405  return NULL;
25406  }
25407  length = (Py_ssize_t) slen;
25408  if (start < 0) {
25409  start += length;
25410  if (start < 0)
25411  start = 0;
25412  }
25413  if (stop < 0)
25414  stop += length;
25415  }
25416  if (unlikely(stop <= start))
25417  return __Pyx_NewRef(__pyx_empty_unicode);
25418  length = stop - start;
25419  cstring += start;
25420  if (decode_func) {
25421  return decode_func(cstring, length, errors);
25422  } else {
25423  return PyUnicode_Decode(cstring, length, encoding, errors);
25424  }
25425 }
25426 
25427 /* GetAttr3 */
25428 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25429  __Pyx_PyThreadState_declare
25430  __Pyx_PyThreadState_assign
25431  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25432  return NULL;
25433  __Pyx_PyErr_Clear();
25434  Py_INCREF(d);
25435  return d;
25436 }
25437 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25438  PyObject *r = __Pyx_GetAttr(o, n);
25439  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25440 }
25441 
25442 /* PyDictVersioning */
25443 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
25444 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
25445  PyObject *dict = Py_TYPE(obj)->tp_dict;
25446  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
25447 }
25448 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
25449  PyObject **dictptr = NULL;
25450  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
25451  if (offset) {
25452 #if CYTHON_COMPILING_IN_CPYTHON
25453  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
25454 #else
25455  dictptr = _PyObject_GetDictPtr(obj);
25456 #endif
25457  }
25458  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
25459 }
25460 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
25461  PyObject *dict = Py_TYPE(obj)->tp_dict;
25462  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
25463  return 0;
25464  return obj_dict_version == __Pyx_get_object_dict_version(obj);
25465 }
25466 #endif
25467 
25468 /* GetModuleGlobalName */
25469 #if CYTHON_USE_DICT_VERSIONS
25470 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
25471 #else
25472 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
25473 #endif
25474 {
25475  PyObject *result;
25476 #if !CYTHON_AVOID_BORROWED_REFS
25477 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25478  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25479  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25480  if (likely(result)) {
25481  return __Pyx_NewRef(result);
25482  } else if (unlikely(PyErr_Occurred())) {
25483  return NULL;
25484  }
25485 #else
25486  result = PyDict_GetItem(__pyx_d, name);
25487  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25488  if (likely(result)) {
25489  return __Pyx_NewRef(result);
25490  }
25491 #endif
25492 #else
25493  result = PyObject_GetItem(__pyx_d, name);
25494  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25495  if (likely(result)) {
25496  return __Pyx_NewRef(result);
25497  }
25498  PyErr_Clear();
25499 #endif
25500  return __Pyx_GetBuiltinName(name);
25501 }
25502 
25503 /* SwapException */
25504 #if CYTHON_FAST_THREAD_STATE
25505 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25506  PyObject *tmp_type, *tmp_value, *tmp_tb;
25507  #if CYTHON_USE_EXC_INFO_STACK
25508  _PyErr_StackItem *exc_info = tstate->exc_info;
25509  tmp_type = exc_info->exc_type;
25510  tmp_value = exc_info->exc_value;
25511  tmp_tb = exc_info->exc_traceback;
25512  exc_info->exc_type = *type;
25513  exc_info->exc_value = *value;
25514  exc_info->exc_traceback = *tb;
25515  #else
25516  tmp_type = tstate->exc_type;
25517  tmp_value = tstate->exc_value;
25518  tmp_tb = tstate->exc_traceback;
25519  tstate->exc_type = *type;
25520  tstate->exc_value = *value;
25521  tstate->exc_traceback = *tb;
25522  #endif
25523  *type = tmp_type;
25524  *value = tmp_value;
25525  *tb = tmp_tb;
25526 }
25527 #else
25528 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25529  PyObject *tmp_type, *tmp_value, *tmp_tb;
25530  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25531  PyErr_SetExcInfo(*type, *value, *tb);
25532  *type = tmp_type;
25533  *value = tmp_value;
25534  *tb = tmp_tb;
25535 }
25536 #endif
25537 
25538 /* Import */
25539 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25540  PyObject *empty_list = 0;
25541  PyObject *module = 0;
25542  PyObject *global_dict = 0;
25543  PyObject *empty_dict = 0;
25544  PyObject *list;
25545  #if PY_MAJOR_VERSION < 3
25546  PyObject *py_import;
25547  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25548  if (!py_import)
25549  goto bad;
25550  #endif
25551  if (from_list)
25552  list = from_list;
25553  else {
25554  empty_list = PyList_New(0);
25555  if (!empty_list)
25556  goto bad;
25557  list = empty_list;
25558  }
25559  global_dict = PyModule_GetDict(__pyx_m);
25560  if (!global_dict)
25561  goto bad;
25562  empty_dict = PyDict_New();
25563  if (!empty_dict)
25564  goto bad;
25565  {
25566  #if PY_MAJOR_VERSION >= 3
25567  if (level == -1) {
25568  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
25569  module = PyImport_ImportModuleLevelObject(
25570  name, global_dict, empty_dict, list, 1);
25571  if (!module) {
25572  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25573  goto bad;
25574  PyErr_Clear();
25575  }
25576  }
25577  level = 0;
25578  }
25579  #endif
25580  if (!module) {
25581  #if PY_MAJOR_VERSION < 3
25582  PyObject *py_level = PyInt_FromLong(level);
25583  if (!py_level)
25584  goto bad;
25585  module = PyObject_CallFunctionObjArgs(py_import,
25586  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25587  Py_DECREF(py_level);
25588  #else
25589  module = PyImport_ImportModuleLevelObject(
25590  name, global_dict, empty_dict, list, level);
25591  #endif
25592  }
25593  }
25594 bad:
25595  #if PY_MAJOR_VERSION < 3
25596  Py_XDECREF(py_import);
25597  #endif
25598  Py_XDECREF(empty_list);
25599  Py_XDECREF(empty_dict);
25600  return module;
25601 }
25602 
25603 /* FastTypeChecks */
25604 #if CYTHON_COMPILING_IN_CPYTHON
25605 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25606  while (a) {
25607  a = a->tp_base;
25608  if (a == b)
25609  return 1;
25610  }
25611  return b == &PyBaseObject_Type;
25612 }
25613 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25614  PyObject *mro;
25615  if (a == b) return 1;
25616  mro = a->tp_mro;
25617  if (likely(mro)) {
25618  Py_ssize_t i, n;
25619  n = PyTuple_GET_SIZE(mro);
25620  for (i = 0; i < n; i++) {
25621  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25622  return 1;
25623  }
25624  return 0;
25625  }
25626  return __Pyx_InBases(a, b);
25627 }
25628 #if PY_MAJOR_VERSION == 2
25629 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25630  PyObject *exception, *value, *tb;
25631  int res;
25632  __Pyx_PyThreadState_declare
25633  __Pyx_PyThreadState_assign
25634  __Pyx_ErrFetch(&exception, &value, &tb);
25635  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25636  if (unlikely(res == -1)) {
25637  PyErr_WriteUnraisable(err);
25638  res = 0;
25639  }
25640  if (!res) {
25641  res = PyObject_IsSubclass(err, exc_type2);
25642  if (unlikely(res == -1)) {
25643  PyErr_WriteUnraisable(err);
25644  res = 0;
25645  }
25646  }
25647  __Pyx_ErrRestore(exception, value, tb);
25648  return res;
25649 }
25650 #else
25651 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25652  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25653  if (!res) {
25654  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25655  }
25656  return res;
25657 }
25658 #endif
25659 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25660  Py_ssize_t i, n;
25661  assert(PyExceptionClass_Check(exc_type));
25662  n = PyTuple_GET_SIZE(tuple);
25663 #if PY_MAJOR_VERSION >= 3
25664  for (i=0; i<n; i++) {
25665  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25666  }
25667 #endif
25668  for (i=0; i<n; i++) {
25669  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25670  #if PY_MAJOR_VERSION < 3
25671  if (likely(exc_type == t)) return 1;
25672  #endif
25673  if (likely(PyExceptionClass_Check(t))) {
25674  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25675  } else {
25676  }
25677  }
25678  return 0;
25679 }
25680 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25681  if (likely(err == exc_type)) return 1;
25682  if (likely(PyExceptionClass_Check(err))) {
25683  if (likely(PyExceptionClass_Check(exc_type))) {
25684  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25685  } else if (likely(PyTuple_Check(exc_type))) {
25686  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25687  } else {
25688  }
25689  }
25690  return PyErr_GivenExceptionMatches(err, exc_type);
25691 }
25692 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25693  assert(PyExceptionClass_Check(exc_type1));
25694  assert(PyExceptionClass_Check(exc_type2));
25695  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25696  if (likely(PyExceptionClass_Check(err))) {
25697  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25698  }
25699  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25700 }
25701 #endif
25702 
25703 /* PyIntBinop */
25704 #if !CYTHON_COMPILING_IN_PYPY
25705 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
25706  (void)inplace;
25707  (void)zerodivision_check;
25708  #if PY_MAJOR_VERSION < 3
25709  if (likely(PyInt_CheckExact(op1))) {
25710  const long b = intval;
25711  long x;
25712  long a = PyInt_AS_LONG(op1);
25713  x = (long)((unsigned long)a + b);
25714  if (likely((x^a) >= 0 || (x^b) >= 0))
25715  return PyInt_FromLong(x);
25716  return PyLong_Type.tp_as_number->nb_add(op1, op2);
25717  }
25718  #endif
25719  #if CYTHON_USE_PYLONG_INTERNALS
25720  if (likely(PyLong_CheckExact(op1))) {
25721  const long b = intval;
25722  long a, x;
25723 #ifdef HAVE_LONG_LONG
25724  const PY_LONG_LONG llb = intval;
25725  PY_LONG_LONG lla, llx;
25726 #endif
25727  const digit* digits = ((PyLongObject*)op1)->ob_digit;
25728  const Py_ssize_t size = Py_SIZE(op1);
25729  if (likely(__Pyx_sst_abs(size) <= 1)) {
25730  a = likely(size) ? digits[0] : 0;
25731  if (size == -1) a = -a;
25732  } else {
25733  switch (size) {
25734  case -2:
25735  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25736  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25737  break;
25738 #ifdef HAVE_LONG_LONG
25739  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25740  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25741  goto long_long;
25742 #endif
25743  }
25744  CYTHON_FALLTHROUGH;
25745  case 2:
25746  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25747  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25748  break;
25749 #ifdef HAVE_LONG_LONG
25750  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25751  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25752  goto long_long;
25753 #endif
25754  }
25755  CYTHON_FALLTHROUGH;
25756  case -3:
25757  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25758  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25759  break;
25760 #ifdef HAVE_LONG_LONG
25761  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25762  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25763  goto long_long;
25764 #endif
25765  }
25766  CYTHON_FALLTHROUGH;
25767  case 3:
25768  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25769  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25770  break;
25771 #ifdef HAVE_LONG_LONG
25772  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25773  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25774  goto long_long;
25775 #endif
25776  }
25777  CYTHON_FALLTHROUGH;
25778  case -4:
25779  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25780  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25781  break;
25782 #ifdef HAVE_LONG_LONG
25783  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25784  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25785  goto long_long;
25786 #endif
25787  }
25788  CYTHON_FALLTHROUGH;
25789  case 4:
25790  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25791  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25792  break;
25793 #ifdef HAVE_LONG_LONG
25794  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25795  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25796  goto long_long;
25797 #endif
25798  }
25799  CYTHON_FALLTHROUGH;
25800  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
25801  }
25802  }
25803  x = a + b;
25804  return PyLong_FromLong(x);
25805 #ifdef HAVE_LONG_LONG
25806  long_long:
25807  llx = lla + llb;
25808  return PyLong_FromLongLong(llx);
25809 #endif
25810 
25811 
25812  }
25813  #endif
25814  if (PyFloat_CheckExact(op1)) {
25815  const long b = intval;
25816  double a = PyFloat_AS_DOUBLE(op1);
25817  double result;
25818  PyFPE_START_PROTECT("add", return NULL)
25819  result = ((double)a) + (double)b;
25820  PyFPE_END_PROTECT(result)
25821  return PyFloat_FromDouble(result);
25822  }
25823  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25824 }
25825 #endif
25826 
25827 /* None */
25828 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25829  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25830 }
25831 
25832 /* None */
25833 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
25834  long q = a / b;
25835  long r = a - q*b;
25836  q -= ((r != 0) & ((r ^ b) < 0));
25837  return q;
25838 }
25839 
25840 /* ImportFrom */
25841 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25842  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25843  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25844  PyErr_Format(PyExc_ImportError,
25845  #if PY_MAJOR_VERSION < 3
25846  "cannot import name %.230s", PyString_AS_STRING(name));
25847  #else
25848  "cannot import name %S", name);
25849  #endif
25850  }
25851  return value;
25852 }
25853 
25854 /* HasAttr */
25855 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25856  PyObject *r;
25857  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25858  PyErr_SetString(PyExc_TypeError,
25859  "hasattr(): attribute name must be string");
25860  return -1;
25861  }
25862  r = __Pyx_GetAttr(o, n);
25863  if (unlikely(!r)) {
25864  PyErr_Clear();
25865  return 0;
25866  } else {
25867  Py_DECREF(r);
25868  return 1;
25869  }
25870 }
25871 
25872 /* PyObject_GenericGetAttrNoDict */
25873 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25874 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25875  PyErr_Format(PyExc_AttributeError,
25876 #if PY_MAJOR_VERSION >= 3
25877  "'%.50s' object has no attribute '%U'",
25878  tp->tp_name, attr_name);
25879 #else
25880  "'%.50s' object has no attribute '%.400s'",
25881  tp->tp_name, PyString_AS_STRING(attr_name));
25882 #endif
25883  return NULL;
25884 }
25885 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25886  PyObject *descr;
25887  PyTypeObject *tp = Py_TYPE(obj);
25888  if (unlikely(!PyString_Check(attr_name))) {
25889  return PyObject_GenericGetAttr(obj, attr_name);
25890  }
25891  assert(!tp->tp_dictoffset);
25892  descr = _PyType_Lookup(tp, attr_name);
25893  if (unlikely(!descr)) {
25894  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25895  }
25896  Py_INCREF(descr);
25897  #if PY_MAJOR_VERSION < 3
25898  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25899  #endif
25900  {
25901  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25902  if (unlikely(f)) {
25903  PyObject *res = f(descr, obj, (PyObject *)tp);
25904  Py_DECREF(descr);
25905  return res;
25906  }
25907  }
25908  return descr;
25909 }
25910 #endif
25911 
25912 /* PyObject_GenericGetAttr */
25913 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25914 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25915  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25916  return PyObject_GenericGetAttr(obj, attr_name);
25917  }
25918  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25919 }
25920 #endif
25921 
25922 /* PyObjectGetAttrStrNoError */
25923 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
25924  __Pyx_PyThreadState_declare
25925  __Pyx_PyThreadState_assign
25926  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25927  __Pyx_PyErr_Clear();
25928 }
25929 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25930  PyObject *result;
25931 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25932  PyTypeObject* tp = Py_TYPE(obj);
25933  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25934  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25935  }
25936 #endif
25937  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25938  if (unlikely(!result)) {
25939  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25940  }
25941  return result;
25942 }
25943 
25944 /* SetupReduce */
25945 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25946  int ret;
25947  PyObject *name_attr;
25948  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25949  if (likely(name_attr)) {
25950  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25951  } else {
25952  ret = -1;
25953  }
25954  if (unlikely(ret < 0)) {
25955  PyErr_Clear();
25956  ret = 0;
25957  }
25958  Py_XDECREF(name_attr);
25959  return ret;
25960 }
25961 static int __Pyx_setup_reduce(PyObject* type_obj) {
25962  int ret = 0;
25963  PyObject *object_reduce = NULL;
25964  PyObject *object_reduce_ex = NULL;
25965  PyObject *reduce = NULL;
25966  PyObject *reduce_ex = NULL;
25967  PyObject *reduce_cython = NULL;
25968  PyObject *setstate = NULL;
25969  PyObject *setstate_cython = NULL;
25970 #if CYTHON_USE_PYTYPE_LOOKUP
25971  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25972 #else
25973  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25974 #endif
25975 #if CYTHON_USE_PYTYPE_LOOKUP
25976  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25977 #else
25978  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25979 #endif
25980  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
25981  if (reduce_ex == object_reduce_ex) {
25982 #if CYTHON_USE_PYTYPE_LOOKUP
25983  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25984 #else
25985  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25986 #endif
25987  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
25988  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25989  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25990  if (likely(reduce_cython)) {
25991  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25992  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25993  } else if (reduce == object_reduce || PyErr_Occurred()) {
25994  goto __PYX_BAD;
25995  }
25996  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25997  if (!setstate) PyErr_Clear();
25998  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25999  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
26000  if (likely(setstate_cython)) {
26001  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26002  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26003  } else if (!setstate || PyErr_Occurred()) {
26004  goto __PYX_BAD;
26005  }
26006  }
26007  PyType_Modified((PyTypeObject*)type_obj);
26008  }
26009  }
26010  goto __PYX_GOOD;
26011 __PYX_BAD:
26012  if (!PyErr_Occurred())
26013  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26014  ret = -1;
26015 __PYX_GOOD:
26016 #if !CYTHON_USE_PYTYPE_LOOKUP
26017  Py_XDECREF(object_reduce);
26018  Py_XDECREF(object_reduce_ex);
26019 #endif
26020  Py_XDECREF(reduce);
26021  Py_XDECREF(reduce_ex);
26022  Py_XDECREF(reduce_cython);
26023  Py_XDECREF(setstate);
26024  Py_XDECREF(setstate_cython);
26025  return ret;
26026 }
26027 
26028 /* SetVTable */
26029 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
26030 #if PY_VERSION_HEX >= 0x02070000
26031  PyObject *ob = PyCapsule_New(vtable, 0, 0);
26032 #else
26033  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26034 #endif
26035  if (!ob)
26036  goto bad;
26037  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26038  goto bad;
26039  Py_DECREF(ob);
26040  return 0;
26041 bad:
26042  Py_XDECREF(ob);
26043  return -1;
26044 }
26045 
26046 /* TypeImport */
26047 #ifndef __PYX_HAVE_RT_ImportType
26048 #define __PYX_HAVE_RT_ImportType
26049 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
26050  size_t size, enum __Pyx_ImportType_CheckSize check_size)
26051 {
26052  PyObject *result = 0;
26053  char warning[200];
26054  Py_ssize_t basicsize;
26055 #ifdef Py_LIMITED_API
26056  PyObject *py_basicsize;
26057 #endif
26058  result = PyObject_GetAttrString(module, class_name);
26059  if (!result)
26060  goto bad;
26061  if (!PyType_Check(result)) {
26062  PyErr_Format(PyExc_TypeError,
26063  "%.200s.%.200s is not a type object",
26064  module_name, class_name);
26065  goto bad;
26066  }
26067 #ifndef Py_LIMITED_API
26068  basicsize = ((PyTypeObject *)result)->tp_basicsize;
26069 #else
26070  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
26071  if (!py_basicsize)
26072  goto bad;
26073  basicsize = PyLong_AsSsize_t(py_basicsize);
26074  Py_DECREF(py_basicsize);
26075  py_basicsize = 0;
26076  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
26077  goto bad;
26078 #endif
26079  if ((size_t)basicsize < size) {
26080  PyErr_Format(PyExc_ValueError,
26081  "%.200s.%.200s size changed, may indicate binary incompatibility. "
26082  "Expected %zd from C header, got %zd from PyObject",
26083  module_name, class_name, size, basicsize);
26084  goto bad;
26085  }
26086  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
26087  PyErr_Format(PyExc_ValueError,
26088  "%.200s.%.200s size changed, may indicate binary incompatibility. "
26089  "Expected %zd from C header, got %zd from PyObject",
26090  module_name, class_name, size, basicsize);
26091  goto bad;
26092  }
26093  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
26094  PyOS_snprintf(warning, sizeof(warning),
26095  "%s.%s size changed, may indicate binary incompatibility. "
26096  "Expected %zd from C header, got %zd from PyObject",
26097  module_name, class_name, size, basicsize);
26098  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
26099  }
26100  return (PyTypeObject *)result;
26101 bad:
26102  Py_XDECREF(result);
26103  return NULL;
26104 }
26105 #endif
26106 
26107 /* CalculateMetaclass */
26108 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
26109  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
26110  for (i=0; i < nbases; i++) {
26111  PyTypeObject *tmptype;
26112  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
26113  tmptype = Py_TYPE(tmp);
26114 #if PY_MAJOR_VERSION < 3
26115  if (tmptype == &PyClass_Type)
26116  continue;
26117 #endif
26118  if (!metaclass) {
26119  metaclass = tmptype;
26120  continue;
26121  }
26122  if (PyType_IsSubtype(metaclass, tmptype))
26123  continue;
26124  if (PyType_IsSubtype(tmptype, metaclass)) {
26125  metaclass = tmptype;
26126  continue;
26127  }
26128  PyErr_SetString(PyExc_TypeError,
26129  "metaclass conflict: "
26130  "the metaclass of a derived class "
26131  "must be a (non-strict) subclass "
26132  "of the metaclasses of all its bases");
26133  return NULL;
26134  }
26135  if (!metaclass) {
26136 #if PY_MAJOR_VERSION < 3
26137  metaclass = &PyClass_Type;
26138 #else
26139  metaclass = &PyType_Type;
26140 #endif
26141  }
26142  Py_INCREF((PyObject*) metaclass);
26143  return (PyObject*) metaclass;
26144 }
26145 
26146 /* FetchCommonType */
26147 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
26148  PyObject* fake_module;
26149  PyTypeObject* cached_type = NULL;
26150  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
26151  if (!fake_module) return NULL;
26152  Py_INCREF(fake_module);
26153  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
26154  if (cached_type) {
26155  if (!PyType_Check((PyObject*)cached_type)) {
26156  PyErr_Format(PyExc_TypeError,
26157  "Shared Cython type %.200s is not a type object",
26158  type->tp_name);
26159  goto bad;
26160  }
26161  if (cached_type->tp_basicsize != type->tp_basicsize) {
26162  PyErr_Format(PyExc_TypeError,
26163  "Shared Cython type %.200s has the wrong size, try recompiling",
26164  type->tp_name);
26165  goto bad;
26166  }
26167  } else {
26168  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
26169  PyErr_Clear();
26170  if (PyType_Ready(type) < 0) goto bad;
26171  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
26172  goto bad;
26173  Py_INCREF(type);
26174  cached_type = type;
26175  }
26176 done:
26177  Py_DECREF(fake_module);
26178  return cached_type;
26179 bad:
26180  Py_XDECREF(cached_type);
26181  cached_type = NULL;
26182  goto done;
26183 }
26184 
26185 /* CythonFunctionShared */
26186 #include <structmember.h>
26187 static PyObject *
26188 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
26189 {
26190  if (unlikely(op->func_doc == NULL)) {
26191  if (op->func.m_ml->ml_doc) {
26192 #if PY_MAJOR_VERSION >= 3
26193  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
26194 #else
26195  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
26196 #endif
26197  if (unlikely(op->func_doc == NULL))
26198  return NULL;
26199  } else {
26200  Py_INCREF(Py_None);
26201  return Py_None;
26202  }
26203  }
26204  Py_INCREF(op->func_doc);
26205  return op->func_doc;
26206 }
26207 static int
26208 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26209 {
26210  PyObject *tmp = op->func_doc;
26211  if (value == NULL) {
26212  value = Py_None;
26213  }
26214  Py_INCREF(value);
26215  op->func_doc = value;
26216  Py_XDECREF(tmp);
26217  return 0;
26218 }
26219 static PyObject *
26220 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26221 {
26222  if (unlikely(op->func_name == NULL)) {
26223 #if PY_MAJOR_VERSION >= 3
26224  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
26225 #else
26226  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
26227 #endif
26228  if (unlikely(op->func_name == NULL))
26229  return NULL;
26230  }
26231  Py_INCREF(op->func_name);
26232  return op->func_name;
26233 }
26234 static int
26235 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26236 {
26237  PyObject *tmp;
26238 #if PY_MAJOR_VERSION >= 3
26239  if (unlikely(value == NULL || !PyUnicode_Check(value)))
26240 #else
26241  if (unlikely(value == NULL || !PyString_Check(value)))
26242 #endif
26243  {
26244  PyErr_SetString(PyExc_TypeError,
26245  "__name__ must be set to a string object");
26246  return -1;
26247  }
26248  tmp = op->func_name;
26249  Py_INCREF(value);
26250  op->func_name = value;
26251  Py_XDECREF(tmp);
26252  return 0;
26253 }
26254 static PyObject *
26255 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26256 {
26257  Py_INCREF(op->func_qualname);
26258  return op->func_qualname;
26259 }
26260 static int
26261 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26262 {
26263  PyObject *tmp;
26264 #if PY_MAJOR_VERSION >= 3
26265  if (unlikely(value == NULL || !PyUnicode_Check(value)))
26266 #else
26267  if (unlikely(value == NULL || !PyString_Check(value)))
26268 #endif
26269  {
26270  PyErr_SetString(PyExc_TypeError,
26271  "__qualname__ must be set to a string object");
26272  return -1;
26273  }
26274  tmp = op->func_qualname;
26275  Py_INCREF(value);
26276  op->func_qualname = value;
26277  Py_XDECREF(tmp);
26278  return 0;
26279 }
26280 static PyObject *
26281 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
26282 {
26283  PyObject *self;
26284  self = m->func_closure;
26285  if (self == NULL)
26286  self = Py_None;
26287  Py_INCREF(self);
26288  return self;
26289 }
26290 static PyObject *
26291 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26292 {
26293  if (unlikely(op->func_dict == NULL)) {
26294  op->func_dict = PyDict_New();
26295  if (unlikely(op->func_dict == NULL))
26296  return NULL;
26297  }
26298  Py_INCREF(op->func_dict);
26299  return op->func_dict;
26300 }
26301 static int
26302 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
26303 {
26304  PyObject *tmp;
26305  if (unlikely(value == NULL)) {
26306  PyErr_SetString(PyExc_TypeError,
26307  "function's dictionary may not be deleted");
26308  return -1;
26309  }
26310  if (unlikely(!PyDict_Check(value))) {
26311  PyErr_SetString(PyExc_TypeError,
26312  "setting function's dictionary to a non-dict");
26313  return -1;
26314  }
26315  tmp = op->func_dict;
26316  Py_INCREF(value);
26317  op->func_dict = value;
26318  Py_XDECREF(tmp);
26319  return 0;
26320 }
26321 static PyObject *
26322 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26323 {
26324  Py_INCREF(op->func_globals);
26325  return op->func_globals;
26326 }
26327 static PyObject *
26328 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26329 {
26330  Py_INCREF(Py_None);
26331  return Py_None;
26332 }
26333 static PyObject *
26334 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
26335 {
26336  PyObject* result = (op->func_code) ? op->func_code : Py_None;
26337  Py_INCREF(result);
26338  return result;
26339 }
26340 static int
26341 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
26342  int result = 0;
26343  PyObject *res = op->defaults_getter((PyObject *) op);
26344  if (unlikely(!res))
26345  return -1;
26346  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26347  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
26348  Py_INCREF(op->defaults_tuple);
26349  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
26350  Py_INCREF(op->defaults_kwdict);
26351  #else
26352  op->defaults_tuple = PySequence_ITEM(res, 0);
26353  if (unlikely(!op->defaults_tuple)) result = -1;
26354  else {
26355  op->defaults_kwdict = PySequence_ITEM(res, 1);
26356  if (unlikely(!op->defaults_kwdict)) result = -1;
26357  }
26358  #endif
26359  Py_DECREF(res);
26360  return result;
26361 }
26362 static int
26363 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26364  PyObject* tmp;
26365  if (!value) {
26366  value = Py_None;
26367  } else if (value != Py_None && !PyTuple_Check(value)) {
26368  PyErr_SetString(PyExc_TypeError,
26369  "__defaults__ must be set to a tuple object");
26370  return -1;
26371  }
26372  Py_INCREF(value);
26373  tmp = op->defaults_tuple;
26374  op->defaults_tuple = value;
26375  Py_XDECREF(tmp);
26376  return 0;
26377 }
26378 static PyObject *
26379 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26380  PyObject* result = op->defaults_tuple;
26381  if (unlikely(!result)) {
26382  if (op->defaults_getter) {
26383  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26384  result = op->defaults_tuple;
26385  } else {
26386  result = Py_None;
26387  }
26388  }
26389  Py_INCREF(result);
26390  return result;
26391 }
26392 static int
26393 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26394  PyObject* tmp;
26395  if (!value) {
26396  value = Py_None;
26397  } else if (value != Py_None && !PyDict_Check(value)) {
26398  PyErr_SetString(PyExc_TypeError,
26399  "__kwdefaults__ must be set to a dict object");
26400  return -1;
26401  }
26402  Py_INCREF(value);
26403  tmp = op->defaults_kwdict;
26404  op->defaults_kwdict = value;
26405  Py_XDECREF(tmp);
26406  return 0;
26407 }
26408 static PyObject *
26409 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26410  PyObject* result = op->defaults_kwdict;
26411  if (unlikely(!result)) {
26412  if (op->defaults_getter) {
26413  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26414  result = op->defaults_kwdict;
26415  } else {
26416  result = Py_None;
26417  }
26418  }
26419  Py_INCREF(result);
26420  return result;
26421 }
26422 static int
26423 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26424  PyObject* tmp;
26425  if (!value || value == Py_None) {
26426  value = NULL;
26427  } else if (!PyDict_Check(value)) {
26428  PyErr_SetString(PyExc_TypeError,
26429  "__annotations__ must be set to a dict object");
26430  return -1;
26431  }
26432  Py_XINCREF(value);
26433  tmp = op->func_annotations;
26434  op->func_annotations = value;
26435  Py_XDECREF(tmp);
26436  return 0;
26437 }
26438 static PyObject *
26439 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26440  PyObject* result = op->func_annotations;
26441  if (unlikely(!result)) {
26442  result = PyDict_New();
26443  if (unlikely(!result)) return NULL;
26444  op->func_annotations = result;
26445  }
26446  Py_INCREF(result);
26447  return result;
26448 }
26449 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26450  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26451  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26452  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26453  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26454  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26455  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26456  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26457  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26458  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26459  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26460  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26461  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26462  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26463  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26464  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26465  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26466  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26467  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26468  {0, 0, 0, 0, 0}
26469 };
26470 static PyMemberDef __pyx_CyFunction_members[] = {
26471  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26472  {0, 0, 0, 0, 0}
26473 };
26474 static PyObject *
26475 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26476 {
26477 #if PY_MAJOR_VERSION >= 3
26478  return PyUnicode_FromString(m->func.m_ml->ml_name);
26479 #else
26480  return PyString_FromString(m->func.m_ml->ml_name);
26481 #endif
26482 }
26483 static PyMethodDef __pyx_CyFunction_methods[] = {
26484  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26485  {0, 0, 0, 0}
26486 };
26487 #if PY_VERSION_HEX < 0x030500A0
26488 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26489 #else
26490 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26491 #endif
26492 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
26493  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26494  if (unlikely(op == NULL))
26495  return NULL;
26496  op->flags = flags;
26497  __Pyx_CyFunction_weakreflist(op) = NULL;
26498  op->func.m_ml = ml;
26499  op->func.m_self = (PyObject *) op;
26500  Py_XINCREF(closure);
26501  op->func_closure = closure;
26502  Py_XINCREF(module);
26503  op->func.m_module = module;
26504  op->func_dict = NULL;
26505  op->func_name = NULL;
26506  Py_INCREF(qualname);
26507  op->func_qualname = qualname;
26508  op->func_doc = NULL;
26509  op->func_classobj = NULL;
26510  op->func_globals = globals;
26511  Py_INCREF(op->func_globals);
26512  Py_XINCREF(code);
26513  op->func_code = code;
26514  op->defaults_pyobjects = 0;
26515  op->defaults_size = 0;
26516  op->defaults = NULL;
26517  op->defaults_tuple = NULL;
26518  op->defaults_kwdict = NULL;
26519  op->defaults_getter = NULL;
26520  op->func_annotations = NULL;
26521  return (PyObject *) op;
26522 }
26523 static int
26524 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26525 {
26526  Py_CLEAR(m->func_closure);
26527  Py_CLEAR(m->func.m_module);
26528  Py_CLEAR(m->func_dict);
26529  Py_CLEAR(m->func_name);
26530  Py_CLEAR(m->func_qualname);
26531  Py_CLEAR(m->func_doc);
26532  Py_CLEAR(m->func_globals);
26533  Py_CLEAR(m->func_code);
26534  Py_CLEAR(m->func_classobj);
26535  Py_CLEAR(m->defaults_tuple);
26536  Py_CLEAR(m->defaults_kwdict);
26537  Py_CLEAR(m->func_annotations);
26538  if (m->defaults) {
26539  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26540  int i;
26541  for (i = 0; i < m->defaults_pyobjects; i++)
26542  Py_XDECREF(pydefaults[i]);
26543  PyObject_Free(m->defaults);
26544  m->defaults = NULL;
26545  }
26546  return 0;
26547 }
26548 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26549 {
26550  if (__Pyx_CyFunction_weakreflist(m) != NULL)
26551  PyObject_ClearWeakRefs((PyObject *) m);
26552  __Pyx_CyFunction_clear(m);
26553  PyObject_GC_Del(m);
26554 }
26555 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26556 {
26557  PyObject_GC_UnTrack(m);
26558  __Pyx__CyFunction_dealloc(m);
26559 }
26560 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
26561 {
26562  Py_VISIT(m->func_closure);
26563  Py_VISIT(m->func.m_module);
26564  Py_VISIT(m->func_dict);
26565  Py_VISIT(m->func_name);
26566  Py_VISIT(m->func_qualname);
26567  Py_VISIT(m->func_doc);
26568  Py_VISIT(m->func_globals);
26569  Py_VISIT(m->func_code);
26570  Py_VISIT(m->func_classobj);
26571  Py_VISIT(m->defaults_tuple);
26572  Py_VISIT(m->defaults_kwdict);
26573  if (m->defaults) {
26574  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26575  int i;
26576  for (i = 0; i < m->defaults_pyobjects; i++)
26577  Py_VISIT(pydefaults[i]);
26578  }
26579  return 0;
26580 }
26581 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26582 {
26583 #if PY_MAJOR_VERSION < 3
26584  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26585  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26586  Py_INCREF(func);
26587  return func;
26588  }
26589  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26590  if (type == NULL)
26591  type = (PyObject *)(Py_TYPE(obj));
26592  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26593  }
26594  if (obj == Py_None)
26595  obj = NULL;
26596 #endif
26597  return __Pyx_PyMethod_New(func, obj, type);
26598 }
26599 static PyObject*
26600 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26601 {
26602 #if PY_MAJOR_VERSION >= 3
26603  return PyUnicode_FromFormat("<cyfunction %U at %p>",
26604  op->func_qualname, (void *)op);
26605 #else
26606  return PyString_FromFormat("<cyfunction %s at %p>",
26607  PyString_AsString(op->func_qualname), (void *)op);
26608 #endif
26609 }
26610 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
26611  PyCFunctionObject* f = (PyCFunctionObject*)func;
26612  PyCFunction meth = f->m_ml->ml_meth;
26613  Py_ssize_t size;
26614  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26615  case METH_VARARGS:
26616  if (likely(kw == NULL || PyDict_Size(kw) == 0))
26617  return (*meth)(self, arg);
26618  break;
26619  case METH_VARARGS | METH_KEYWORDS:
26620  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
26621  case METH_NOARGS:
26622  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26623  size = PyTuple_GET_SIZE(arg);
26624  if (likely(size == 0))
26625  return (*meth)(self, NULL);
26626  PyErr_Format(PyExc_TypeError,
26627  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
26628  f->m_ml->ml_name, size);
26629  return NULL;
26630  }
26631  break;
26632  case METH_O:
26633  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26634  size = PyTuple_GET_SIZE(arg);
26635  if (likely(size == 1)) {
26636  PyObject *result, *arg0;
26637  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26638  arg0 = PyTuple_GET_ITEM(arg, 0);
26639  #else
26640  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
26641  #endif
26642  result = (*meth)(self, arg0);
26643  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26644  Py_DECREF(arg0);
26645  #endif
26646  return result;
26647  }
26648  PyErr_Format(PyExc_TypeError,
26649  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
26650  f->m_ml->ml_name, size);
26651  return NULL;
26652  }
26653  break;
26654  default:
26655  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
26656  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26657  "longer supported!");
26658  return NULL;
26659  }
26660  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
26661  f->m_ml->ml_name);
26662  return NULL;
26663 }
26664 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26665  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26666 }
26667 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26668  PyObject *result;
26669  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26670  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26671  Py_ssize_t argc;
26672  PyObject *new_args;
26673  PyObject *self;
26674  argc = PyTuple_GET_SIZE(args);
26675  new_args = PyTuple_GetSlice(args, 1, argc);
26676  if (unlikely(!new_args))
26677  return NULL;
26678  self = PyTuple_GetItem(args, 0);
26679  if (unlikely(!self)) {
26680  Py_DECREF(new_args);
26681  return NULL;
26682  }
26683  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
26684  Py_DECREF(new_args);
26685  } else {
26686  result = __Pyx_CyFunction_Call(func, args, kw);
26687  }
26688  return result;
26689 }
26690 static PyTypeObject __pyx_CyFunctionType_type = {
26691  PyVarObject_HEAD_INIT(0, 0)
26692  "cython_function_or_method",
26693  sizeof(__pyx_CyFunctionObject),
26694  0,
26695  (destructor) __Pyx_CyFunction_dealloc,
26696  0,
26697  0,
26698  0,
26699 #if PY_MAJOR_VERSION < 3
26700  0,
26701 #else
26702  0,
26703 #endif
26704  (reprfunc) __Pyx_CyFunction_repr,
26705  0,
26706  0,
26707  0,
26708  0,
26709  __Pyx_CyFunction_CallAsMethod,
26710  0,
26711  0,
26712  0,
26713  0,
26714  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26715  0,
26716  (traverseproc) __Pyx_CyFunction_traverse,
26717  (inquiry) __Pyx_CyFunction_clear,
26718  0,
26719 #if PY_VERSION_HEX < 0x030500A0
26720  offsetof(__pyx_CyFunctionObject, func_weakreflist),
26721 #else
26722  offsetof(PyCFunctionObject, m_weakreflist),
26723 #endif
26724  0,
26725  0,
26726  __pyx_CyFunction_methods,
26727  __pyx_CyFunction_members,
26728  __pyx_CyFunction_getsets,
26729  0,
26730  0,
26731  __Pyx_CyFunction_descr_get,
26732  0,
26733  offsetof(__pyx_CyFunctionObject, func_dict),
26734  0,
26735  0,
26736  0,
26737  0,
26738  0,
26739  0,
26740  0,
26741  0,
26742  0,
26743  0,
26744  0,
26745  0,
26746 #if PY_VERSION_HEX >= 0x030400a1
26747  0,
26748 #endif
26749 #if PY_VERSION_HEX >= 0x030800b1
26750  0,
26751 #endif
26752 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26753  0,
26754 #endif
26755 };
26756 static int __pyx_CyFunction_init(void) {
26757  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26758  if (unlikely(__pyx_CyFunctionType == NULL)) {
26759  return -1;
26760  }
26761  return 0;
26762 }
26763 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
26764  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26765  m->defaults = PyObject_Malloc(size);
26766  if (unlikely(!m->defaults))
26767  return PyErr_NoMemory();
26768  memset(m->defaults, 0, size);
26769  m->defaults_pyobjects = pyobjects;
26770  m->defaults_size = size;
26771  return m->defaults;
26772 }
26773 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26774  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26775  m->defaults_tuple = tuple;
26776  Py_INCREF(tuple);
26777 }
26778 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26779  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26780  m->defaults_kwdict = dict;
26781  Py_INCREF(dict);
26782 }
26783 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26784  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26785  m->func_annotations = dict;
26786  Py_INCREF(dict);
26787 }
26788 
26789 /* CythonFunction */
26790 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
26791  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26792  PyObject *op = __Pyx_CyFunction_Init(
26793  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26794  ml, flags, qualname, closure, module, globals, code
26795  );
26796  if (likely(op)) {
26797  PyObject_GC_Track(op);
26798  }
26799  return op;
26800 }
26801 
26802 /* Py3ClassCreate */
26803 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
26804  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
26805  PyObject *ns;
26806  if (metaclass) {
26807  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
26808  if (prep) {
26809  PyObject *pargs = PyTuple_Pack(2, name, bases);
26810  if (unlikely(!pargs)) {
26811  Py_DECREF(prep);
26812  return NULL;
26813  }
26814  ns = PyObject_Call(prep, pargs, mkw);
26815  Py_DECREF(prep);
26816  Py_DECREF(pargs);
26817  } else {
26818  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
26819  return NULL;
26820  PyErr_Clear();
26821  ns = PyDict_New();
26822  }
26823  } else {
26824  ns = PyDict_New();
26825  }
26826  if (unlikely(!ns))
26827  return NULL;
26828  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
26829  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
26830  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
26831  return ns;
26832 bad:
26833  Py_DECREF(ns);
26834  return NULL;
26835 }
26836 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
26837  PyObject *dict, PyObject *mkw,
26838  int calculate_metaclass, int allow_py2_metaclass) {
26839  PyObject *result, *margs;
26840  PyObject *owned_metaclass = NULL;
26841  if (allow_py2_metaclass) {
26842  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
26843  if (owned_metaclass) {
26844  metaclass = owned_metaclass;
26845  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
26846  PyErr_Clear();
26847  } else {
26848  return NULL;
26849  }
26850  }
26851  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
26852  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
26853  Py_XDECREF(owned_metaclass);
26854  if (unlikely(!metaclass))
26855  return NULL;
26856  owned_metaclass = metaclass;
26857  }
26858  margs = PyTuple_Pack(3, name, bases, dict);
26859  if (unlikely(!margs)) {
26860  result = NULL;
26861  } else {
26862  result = PyObject_Call(metaclass, margs, mkw);
26863  Py_DECREF(margs);
26864  }
26865  Py_XDECREF(owned_metaclass);
26866  return result;
26867 }
26868 
26869 /* CLineInTraceback */
26870 #ifndef CYTHON_CLINE_IN_TRACEBACK
26871 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
26872  PyObject *use_cline;
26873  PyObject *ptype, *pvalue, *ptraceback;
26874 #if CYTHON_COMPILING_IN_CPYTHON
26875  PyObject **cython_runtime_dict;
26876 #endif
26877  if (unlikely(!__pyx_cython_runtime)) {
26878  return c_line;
26879  }
26880  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26881 #if CYTHON_COMPILING_IN_CPYTHON
26882  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26883  if (likely(cython_runtime_dict)) {
26884  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26885  use_cline, *cython_runtime_dict,
26886  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26887  } else
26888 #endif
26889  {
26890  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26891  if (use_cline_obj) {
26892  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26893  Py_DECREF(use_cline_obj);
26894  } else {
26895  PyErr_Clear();
26896  use_cline = NULL;
26897  }
26898  }
26899  if (!use_cline) {
26900  c_line = 0;
26901  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26902  }
26903  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26904  c_line = 0;
26905  }
26906  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26907  return c_line;
26908 }
26909 #endif
26910 
26911 /* CodeObjectCache */
26912 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
26913  int start = 0, mid = 0, end = count - 1;
26914  if (end >= 0 && code_line > entries[end].code_line) {
26915  return count;
26916  }
26917  while (start < end) {
26918  mid = start + (end - start) / 2;
26919  if (code_line < entries[mid].code_line) {
26920  end = mid;
26921  } else if (code_line > entries[mid].code_line) {
26922  start = mid + 1;
26923  } else {
26924  return mid;
26925  }
26926  }
26927  if (code_line <= entries[mid].code_line) {
26928  return mid;
26929  } else {
26930  return mid + 1;
26931  }
26932 }
26933 static PyCodeObject *__pyx_find_code_object(int code_line) {
26934  PyCodeObject* code_object;
26935  int pos;
26936  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26937  return NULL;
26938  }
26939  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26940  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26941  return NULL;
26942  }
26943  code_object = __pyx_code_cache.entries[pos].code_object;
26944  Py_INCREF(code_object);
26945  return code_object;
26946 }
26947 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26948  int pos, i;
26949  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26950  if (unlikely(!code_line)) {
26951  return;
26952  }
26953  if (unlikely(!entries)) {
26954  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26955  if (likely(entries)) {
26956  __pyx_code_cache.entries = entries;
26957  __pyx_code_cache.max_count = 64;
26958  __pyx_code_cache.count = 1;
26959  entries[0].code_line = code_line;
26960  entries[0].code_object = code_object;
26961  Py_INCREF(code_object);
26962  }
26963  return;
26964  }
26965  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26966  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26967  PyCodeObject* tmp = entries[pos].code_object;
26968  entries[pos].code_object = code_object;
26969  Py_DECREF(tmp);
26970  return;
26971  }
26972  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26973  int new_max = __pyx_code_cache.max_count + 64;
26974  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26975  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
26976  if (unlikely(!entries)) {
26977  return;
26978  }
26979  __pyx_code_cache.entries = entries;
26980  __pyx_code_cache.max_count = new_max;
26981  }
26982  for (i=__pyx_code_cache.count; i>pos; i--) {
26983  entries[i] = entries[i-1];
26984  }
26985  entries[pos].code_line = code_line;
26986  entries[pos].code_object = code_object;
26987  __pyx_code_cache.count++;
26988  Py_INCREF(code_object);
26989 }
26990 
26991 /* AddTraceback */
26992 #include "compile.h"
26993 #include "frameobject.h"
26994 #include "traceback.h"
26995 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26996  const char *funcname, int c_line,
26997  int py_line, const char *filename) {
26998  PyCodeObject *py_code = 0;
26999  PyObject *py_srcfile = 0;
27000  PyObject *py_funcname = 0;
27001  #if PY_MAJOR_VERSION < 3
27002  py_srcfile = PyString_FromString(filename);
27003  #else
27004  py_srcfile = PyUnicode_FromString(filename);
27005  #endif
27006  if (!py_srcfile) goto bad;
27007  if (c_line) {
27008  #if PY_MAJOR_VERSION < 3
27009  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27010  #else
27011  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27012  #endif
27013  }
27014  else {
27015  #if PY_MAJOR_VERSION < 3
27016  py_funcname = PyString_FromString(funcname);
27017  #else
27018  py_funcname = PyUnicode_FromString(funcname);
27019  #endif
27020  }
27021  if (!py_funcname) goto bad;
27022  py_code = __Pyx_PyCode_New(
27023  0,
27024  0,
27025  0,
27026  0,
27027  0,
27028  __pyx_empty_bytes, /*PyObject *code,*/
27029  __pyx_empty_tuple, /*PyObject *consts,*/
27030  __pyx_empty_tuple, /*PyObject *names,*/
27031  __pyx_empty_tuple, /*PyObject *varnames,*/
27032  __pyx_empty_tuple, /*PyObject *freevars,*/
27033  __pyx_empty_tuple, /*PyObject *cellvars,*/
27034  py_srcfile, /*PyObject *filename,*/
27035  py_funcname, /*PyObject *name,*/
27036  py_line,
27037  __pyx_empty_bytes /*PyObject *lnotab*/
27038  );
27039  Py_DECREF(py_srcfile);
27040  Py_DECREF(py_funcname);
27041  return py_code;
27042 bad:
27043  Py_XDECREF(py_srcfile);
27044  Py_XDECREF(py_funcname);
27045  return NULL;
27046 }
27047 static void __Pyx_AddTraceback(const char *funcname, int c_line,
27048  int py_line, const char *filename) {
27049  PyCodeObject *py_code = 0;
27050  PyFrameObject *py_frame = 0;
27051  PyThreadState *tstate = __Pyx_PyThreadState_Current;
27052  if (c_line) {
27053  c_line = __Pyx_CLineForTraceback(tstate, c_line);
27054  }
27055  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27056  if (!py_code) {
27057  py_code = __Pyx_CreateCodeObjectForTraceback(
27058  funcname, c_line, py_line, filename);
27059  if (!py_code) goto bad;
27060  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27061  }
27062  py_frame = PyFrame_New(
27063  tstate, /*PyThreadState *tstate,*/
27064  py_code, /*PyCodeObject *code,*/
27065  __pyx_d, /*PyObject *globals,*/
27066  0 /*PyObject *locals*/
27067  );
27068  if (!py_frame) goto bad;
27069  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27070  PyTraceBack_Here(py_frame);
27071 bad:
27072  Py_XDECREF(py_code);
27073  Py_XDECREF(py_frame);
27074 }
27075 
27076 #if PY_MAJOR_VERSION < 3
27077 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
27078  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
27079  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
27080  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
27081  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27082  return -1;
27083 }
27084 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27085  PyObject *obj = view->obj;
27086  if (!obj) return;
27087  if (PyObject_CheckBuffer(obj)) {
27088  PyBuffer_Release(view);
27089  return;
27090  }
27091  if ((0)) {}
27092  view->obj = NULL;
27093  Py_DECREF(obj);
27094 }
27095 #endif
27096 
27097 
27098 /* MemviewSliceIsContig */
27099 static int
27100 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
27101 {
27102  int i, index, step, start;
27103  Py_ssize_t itemsize = mvs.memview->view.itemsize;
27104  if (order == 'F') {
27105  step = 1;
27106  start = 0;
27107  } else {
27108  step = -1;
27109  start = ndim - 1;
27110  }
27111  for (i = 0; i < ndim; i++) {
27112  index = start + step * i;
27113  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27114  return 0;
27115  itemsize *= mvs.shape[index];
27116  }
27117  return 1;
27118 }
27119 
27120 /* OverlappingSlices */
27121 static void
27122 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27123  void **out_start, void **out_end,
27124  int ndim, size_t itemsize)
27125 {
27126  char *start, *end;
27127  int i;
27128  start = end = slice->data;
27129  for (i = 0; i < ndim; i++) {
27130  Py_ssize_t stride = slice->strides[i];
27131  Py_ssize_t extent = slice->shape[i];
27132  if (extent == 0) {
27133  *out_start = *out_end = start;
27134  return;
27135  } else {
27136  if (stride > 0)
27137  end += stride * (extent - 1);
27138  else
27139  start += stride * (extent - 1);
27140  }
27141  }
27142  *out_start = start;
27143  *out_end = end + itemsize;
27144 }
27145 static int
27146 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27147  __Pyx_memviewslice *slice2,
27148  int ndim, size_t itemsize)
27149 {
27150  void *start1, *end1, *start2, *end2;
27151  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27152  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27153  return (start1 < end2) && (start2 < end1);
27154 }
27155 
27156 /* Capsule */
27157 static CYTHON_INLINE PyObject *
27158 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
27159 {
27160  PyObject *cobj;
27161 #if PY_VERSION_HEX >= 0x02070000
27162  cobj = PyCapsule_New(p, sig, NULL);
27163 #else
27164  cobj = PyCObject_FromVoidPtr(p, NULL);
27165 #endif
27166  return cobj;
27167 }
27168 
27169 /* CIntFromPyVerify */
27170 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27171  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27172 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27173  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27174 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27175  {\
27176  func_type value = func_value;\
27177  if (sizeof(target_type) < sizeof(func_type)) {\
27178  if (unlikely(value != (func_type) (target_type) value)) {\
27179  func_type zero = 0;\
27180  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27181  return (target_type) -1;\
27182  if (is_unsigned && unlikely(value < zero))\
27183  goto raise_neg_overflow;\
27184  else\
27185  goto raise_overflow;\
27186  }\
27187  }\
27188  return (target_type) value;\
27189  }
27190 
27191 /* Declarations */
27192 #if CYTHON_CCOMPLEX
27193  #ifdef __cplusplus
27194  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27195  return ::std::complex< float >(x, y);
27196  }
27197  #else
27198  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27199  return x + y*(__pyx_t_float_complex)_Complex_I;
27200  }
27201  #endif
27202 #else
27203  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27204  __pyx_t_float_complex z;
27205  z.real = x;
27206  z.imag = y;
27207  return z;
27208  }
27209 #endif
27210 
27211 /* Arithmetic */
27212 #if CYTHON_CCOMPLEX
27213 #else
27214  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27215  return (a.real == b.real) && (a.imag == b.imag);
27216  }
27217  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27218  __pyx_t_float_complex z;
27219  z.real = a.real + b.real;
27220  z.imag = a.imag + b.imag;
27221  return z;
27222  }
27223  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27224  __pyx_t_float_complex z;
27225  z.real = a.real - b.real;
27226  z.imag = a.imag - b.imag;
27227  return z;
27228  }
27229  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27230  __pyx_t_float_complex z;
27231  z.real = a.real * b.real - a.imag * b.imag;
27232  z.imag = a.real * b.imag + a.imag * b.real;
27233  return z;
27234  }
27235  #if 1
27236  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27237  if (b.imag == 0) {
27238  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27239  } else if (fabsf(b.real) >= fabsf(b.imag)) {
27240  if (b.real == 0 && b.imag == 0) {
27241  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27242  } else {
27243  float r = b.imag / b.real;
27244  float s = (float)(1.0) / (b.real + b.imag * r);
27245  return __pyx_t_float_complex_from_parts(
27246  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27247  }
27248  } else {
27249  float r = b.real / b.imag;
27250  float s = (float)(1.0) / (b.imag + b.real * r);
27251  return __pyx_t_float_complex_from_parts(
27252  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27253  }
27254  }
27255  #else
27256  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27257  if (b.imag == 0) {
27258  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27259  } else {
27260  float denom = b.real * b.real + b.imag * b.imag;
27261  return __pyx_t_float_complex_from_parts(
27262  (a.real * b.real + a.imag * b.imag) / denom,
27263  (a.imag * b.real - a.real * b.imag) / denom);
27264  }
27265  }
27266  #endif
27267  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27268  __pyx_t_float_complex z;
27269  z.real = -a.real;
27270  z.imag = -a.imag;
27271  return z;
27272  }
27273  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27274  return (a.real == 0) && (a.imag == 0);
27275  }
27276  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27277  __pyx_t_float_complex z;
27278  z.real = a.real;
27279  z.imag = -a.imag;
27280  return z;
27281  }
27282  #if 1
27283  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
27284  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27285  return sqrtf(z.real*z.real + z.imag*z.imag);
27286  #else
27287  return hypotf(z.real, z.imag);
27288  #endif
27289  }
27290  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27291  __pyx_t_float_complex z;
27292  float r, lnr, theta, z_r, z_theta;
27293  if (b.imag == 0 && b.real == (int)b.real) {
27294  if (b.real < 0) {
27295  float denom = a.real * a.real + a.imag * a.imag;
27296  a.real = a.real / denom;
27297  a.imag = -a.imag / denom;
27298  b.real = -b.real;
27299  }
27300  switch ((int)b.real) {
27301  case 0:
27302  z.real = 1;
27303  z.imag = 0;
27304  return z;
27305  case 1:
27306  return a;
27307  case 2:
27308  return __Pyx_c_prod_float(a, a);
27309  case 3:
27310  z = __Pyx_c_prod_float(a, a);
27311  return __Pyx_c_prod_float(z, a);
27312  case 4:
27313  z = __Pyx_c_prod_float(a, a);
27314  return __Pyx_c_prod_float(z, z);
27315  }
27316  }
27317  if (a.imag == 0) {
27318  if (a.real == 0) {
27319  return a;
27320  } else if (b.imag == 0) {
27321  z.real = powf(a.real, b.real);
27322  z.imag = 0;
27323  return z;
27324  } else if (a.real > 0) {
27325  r = a.real;
27326  theta = 0;
27327  } else {
27328  r = -a.real;
27329  theta = atan2f(0.0, -1.0);
27330  }
27331  } else {
27332  r = __Pyx_c_abs_float(a);
27333  theta = atan2f(a.imag, a.real);
27334  }
27335  lnr = logf(r);
27336  z_r = expf(lnr * b.real - theta * b.imag);
27337  z_theta = theta * b.real + lnr * b.imag;
27338  z.real = z_r * cosf(z_theta);
27339  z.imag = z_r * sinf(z_theta);
27340  return z;
27341  }
27342  #endif
27343 #endif
27344 
27345 /* Declarations */
27346 #if CYTHON_CCOMPLEX
27347  #ifdef __cplusplus
27348  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27349  return ::std::complex< double >(x, y);
27350  }
27351  #else
27352  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27353  return x + y*(__pyx_t_double_complex)_Complex_I;
27354  }
27355  #endif
27356 #else
27357  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27358  __pyx_t_double_complex z;
27359  z.real = x;
27360  z.imag = y;
27361  return z;
27362  }
27363 #endif
27364 
27365 /* Arithmetic */
27366 #if CYTHON_CCOMPLEX
27367 #else
27368  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27369  return (a.real == b.real) && (a.imag == b.imag);
27370  }
27371  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27372  __pyx_t_double_complex z;
27373  z.real = a.real + b.real;
27374  z.imag = a.imag + b.imag;
27375  return z;
27376  }
27377  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27378  __pyx_t_double_complex z;
27379  z.real = a.real - b.real;
27380  z.imag = a.imag - b.imag;
27381  return z;
27382  }
27383  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27384  __pyx_t_double_complex z;
27385  z.real = a.real * b.real - a.imag * b.imag;
27386  z.imag = a.real * b.imag + a.imag * b.real;
27387  return z;
27388  }
27389  #if 1
27390  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27391  if (b.imag == 0) {
27392  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27393  } else if (fabs(b.real) >= fabs(b.imag)) {
27394  if (b.real == 0 && b.imag == 0) {
27395  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27396  } else {
27397  double r = b.imag / b.real;
27398  double s = (double)(1.0) / (b.real + b.imag * r);
27399  return __pyx_t_double_complex_from_parts(
27400  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27401  }
27402  } else {
27403  double r = b.real / b.imag;
27404  double s = (double)(1.0) / (b.imag + b.real * r);
27405  return __pyx_t_double_complex_from_parts(
27406  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27407  }
27408  }
27409  #else
27410  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27411  if (b.imag == 0) {
27412  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27413  } else {
27414  double denom = b.real * b.real + b.imag * b.imag;
27415  return __pyx_t_double_complex_from_parts(
27416  (a.real * b.real + a.imag * b.imag) / denom,
27417  (a.imag * b.real - a.real * b.imag) / denom);
27418  }
27419  }
27420  #endif
27421  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27422  __pyx_t_double_complex z;
27423  z.real = -a.real;
27424  z.imag = -a.imag;
27425  return z;
27426  }
27427  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27428  return (a.real == 0) && (a.imag == 0);
27429  }
27430  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27431  __pyx_t_double_complex z;
27432  z.real = a.real;
27433  z.imag = -a.imag;
27434  return z;
27435  }
27436  #if 1
27437  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
27438  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27439  return sqrt(z.real*z.real + z.imag*z.imag);
27440  #else
27441  return hypot(z.real, z.imag);
27442  #endif
27443  }
27444  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27445  __pyx_t_double_complex z;
27446  double r, lnr, theta, z_r, z_theta;
27447  if (b.imag == 0 && b.real == (int)b.real) {
27448  if (b.real < 0) {
27449  double denom = a.real * a.real + a.imag * a.imag;
27450  a.real = a.real / denom;
27451  a.imag = -a.imag / denom;
27452  b.real = -b.real;
27453  }
27454  switch ((int)b.real) {
27455  case 0:
27456  z.real = 1;
27457  z.imag = 0;
27458  return z;
27459  case 1:
27460  return a;
27461  case 2:
27462  return __Pyx_c_prod_double(a, a);
27463  case 3:
27464  z = __Pyx_c_prod_double(a, a);
27465  return __Pyx_c_prod_double(z, a);
27466  case 4:
27467  z = __Pyx_c_prod_double(a, a);
27468  return __Pyx_c_prod_double(z, z);
27469  }
27470  }
27471  if (a.imag == 0) {
27472  if (a.real == 0) {
27473  return a;
27474  } else if (b.imag == 0) {
27475  z.real = pow(a.real, b.real);
27476  z.imag = 0;
27477  return z;
27478  } else if (a.real > 0) {
27479  r = a.real;
27480  theta = 0;
27481  } else {
27482  r = -a.real;
27483  theta = atan2(0.0, -1.0);
27484  }
27485  } else {
27486  r = __Pyx_c_abs_double(a);
27487  theta = atan2(a.imag, a.real);
27488  }
27489  lnr = log(r);
27490  z_r = exp(lnr * b.real - theta * b.imag);
27491  z_theta = theta * b.real + lnr * b.imag;
27492  z.real = z_r * cos(z_theta);
27493  z.imag = z_r * sin(z_theta);
27494  return z;
27495  }
27496  #endif
27497 #endif
27498 
27499 /* CIntToPy */
27500 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
27501  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
27502  const int is_unsigned = neg_one > const_zero;
27503  if (is_unsigned) {
27504  if (sizeof(int) < sizeof(long)) {
27505  return PyInt_FromLong((long) value);
27506  } else if (sizeof(int) <= sizeof(unsigned long)) {
27507  return PyLong_FromUnsignedLong((unsigned long) value);
27508 #ifdef HAVE_LONG_LONG
27509  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27510  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27511 #endif
27512  }
27513  } else {
27514  if (sizeof(int) <= sizeof(long)) {
27515  return PyInt_FromLong((long) value);
27516 #ifdef HAVE_LONG_LONG
27517  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27518  return PyLong_FromLongLong((PY_LONG_LONG) value);
27519 #endif
27520  }
27521  }
27522  {
27523  int one = 1; int little = (int)*(unsigned char *)&one;
27524  unsigned char *bytes = (unsigned char *)&value;
27525  return _PyLong_FromByteArray(bytes, sizeof(int),
27526  little, !is_unsigned);
27527  }
27528 }
27529 
27530 /* CIntToPy */
27531 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
27532  const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
27533  const int is_unsigned = neg_one > const_zero;
27534  if (is_unsigned) {
27535  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
27536  return PyInt_FromLong((long) value);
27537  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
27538  return PyLong_FromUnsignedLong((unsigned long) value);
27539 #ifdef HAVE_LONG_LONG
27540  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
27541  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27542 #endif
27543  }
27544  } else {
27545  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
27546  return PyInt_FromLong((long) value);
27547 #ifdef HAVE_LONG_LONG
27548  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
27549  return PyLong_FromLongLong((PY_LONG_LONG) value);
27550 #endif
27551  }
27552  }
27553  {
27554  int one = 1; int little = (int)*(unsigned char *)&one;
27555  unsigned char *bytes = (unsigned char *)&value;
27556  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
27557  little, !is_unsigned);
27558  }
27559 }
27560 
27561 /* MemviewSliceCopyTemplate */
27562 static __Pyx_memviewslice
27563 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
27564  const char *mode, int ndim,
27565  size_t sizeof_dtype, int contig_flag,
27566  int dtype_is_object)
27567 {
27568  __Pyx_RefNannyDeclarations
27569  int i;
27570  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27571  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27572  Py_buffer *buf = &from_memview->view;
27573  PyObject *shape_tuple = NULL;
27574  PyObject *temp_int = NULL;
27575  struct __pyx_array_obj *array_obj = NULL;
27576  struct __pyx_memoryview_obj *memview_obj = NULL;
27577  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
27578  for (i = 0; i < ndim; i++) {
27579  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
27580  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
27581  "indirect dimensions (axis %d)", i);
27582  goto fail;
27583  }
27584  }
27585  shape_tuple = PyTuple_New(ndim);
27586  if (unlikely(!shape_tuple)) {
27587  goto fail;
27588  }
27589  __Pyx_GOTREF(shape_tuple);
27590  for(i = 0; i < ndim; i++) {
27591  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27592  if(unlikely(!temp_int)) {
27593  goto fail;
27594  } else {
27595  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27596  temp_int = NULL;
27597  }
27598  }
27599  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
27600  if (unlikely(!array_obj)) {
27601  goto fail;
27602  }
27603  __Pyx_GOTREF(array_obj);
27604  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27605  (PyObject *) array_obj, contig_flag,
27606  dtype_is_object,
27607  from_mvs->memview->typeinfo);
27608  if (unlikely(!memview_obj))
27609  goto fail;
27610  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27611  goto fail;
27612  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27613  dtype_is_object) < 0))
27614  goto fail;
27615  goto no_fail;
27616 fail:
27617  __Pyx_XDECREF(new_mvs.memview);
27618  new_mvs.memview = NULL;
27619  new_mvs.data = NULL;
27620 no_fail:
27621  __Pyx_XDECREF(shape_tuple);
27622  __Pyx_XDECREF(temp_int);
27623  __Pyx_XDECREF(array_obj);
27624  __Pyx_RefNannyFinishContext();
27625  return new_mvs;
27626 }
27627 
27628 /* CIntFromPy */
27629 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
27630  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
27631  const int is_unsigned = neg_one > const_zero;
27632 #if PY_MAJOR_VERSION < 3
27633  if (likely(PyInt_Check(x))) {
27634  if (sizeof(int) < sizeof(long)) {
27635  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
27636  } else {
27637  long val = PyInt_AS_LONG(x);
27638  if (is_unsigned && unlikely(val < 0)) {
27639  goto raise_neg_overflow;
27640  }
27641  return (int) val;
27642  }
27643  } else
27644 #endif
27645  if (likely(PyLong_Check(x))) {
27646  if (is_unsigned) {
27647 #if CYTHON_USE_PYLONG_INTERNALS
27648  const digit* digits = ((PyLongObject*)x)->ob_digit;
27649  switch (Py_SIZE(x)) {
27650  case 0: return (int) 0;
27651  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
27652  case 2:
27653  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27654  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27655  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27656  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
27657  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27658  }
27659  }
27660  break;
27661  case 3:
27662  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27663  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27664  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27665  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
27666  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27667  }
27668  }
27669  break;
27670  case 4:
27671  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27672  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27673  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27674  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
27675  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27676  }
27677  }
27678  break;
27679  }
27680 #endif
27681 #if CYTHON_COMPILING_IN_CPYTHON
27682  if (unlikely(Py_SIZE(x) < 0)) {
27683  goto raise_neg_overflow;
27684  }
27685 #else
27686  {
27687  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27688  if (unlikely(result < 0))
27689  return (int) -1;
27690  if (unlikely(result == 1))
27691  goto raise_neg_overflow;
27692  }
27693 #endif
27694  if (sizeof(int) <= sizeof(unsigned long)) {
27695  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
27696 #ifdef HAVE_LONG_LONG
27697  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27698  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27699 #endif
27700  }
27701  } else {
27702 #if CYTHON_USE_PYLONG_INTERNALS
27703  const digit* digits = ((PyLongObject*)x)->ob_digit;
27704  switch (Py_SIZE(x)) {
27705  case 0: return (int) 0;
27706  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
27707  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
27708  case -2:
27709  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
27710  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27711  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27712  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27713  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27714  }
27715  }
27716  break;
27717  case 2:
27718  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27719  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27720  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27721  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27722  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27723  }
27724  }
27725  break;
27726  case -3:
27727  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27728  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27729  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27730  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27731  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27732  }
27733  }
27734  break;
27735  case 3:
27736  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27737  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27738  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27739  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27740  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27741  }
27742  }
27743  break;
27744  case -4:
27745  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27746  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27747  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27748  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27749  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27750  }
27751  }
27752  break;
27753  case 4:
27754  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27755  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27756  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27757  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27758  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27759  }
27760  }
27761  break;
27762  }
27763 #endif
27764  if (sizeof(int) <= sizeof(long)) {
27765  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
27766 #ifdef HAVE_LONG_LONG
27767  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27768  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
27769 #endif
27770  }
27771  }
27772  {
27773 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27774  PyErr_SetString(PyExc_RuntimeError,
27775  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27776 #else
27777  int val;
27778  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27779  #if PY_MAJOR_VERSION < 3
27780  if (likely(v) && !PyLong_Check(v)) {
27781  PyObject *tmp = v;
27782  v = PyNumber_Long(tmp);
27783  Py_DECREF(tmp);
27784  }
27785  #endif
27786  if (likely(v)) {
27787  int one = 1; int is_little = (int)*(unsigned char *)&one;
27788  unsigned char *bytes = (unsigned char *)&val;
27789  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27790  bytes, sizeof(val),
27791  is_little, !is_unsigned);
27792  Py_DECREF(v);
27793  if (likely(!ret))
27794  return val;
27795  }
27796 #endif
27797  return (int) -1;
27798  }
27799  } else {
27800  int val;
27801  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27802  if (!tmp) return (int) -1;
27803  val = __Pyx_PyInt_As_int(tmp);
27804  Py_DECREF(tmp);
27805  return val;
27806  }
27807 raise_overflow:
27808  PyErr_SetString(PyExc_OverflowError,
27809  "value too large to convert to int");
27810  return (int) -1;
27811 raise_neg_overflow:
27812  PyErr_SetString(PyExc_OverflowError,
27813  "can't convert negative value to int");
27814  return (int) -1;
27815 }
27816 
27817 /* CIntFromPy */
27818 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
27819  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
27820  const int is_unsigned = neg_one > const_zero;
27821 #if PY_MAJOR_VERSION < 3
27822  if (likely(PyInt_Check(x))) {
27823  if (sizeof(long) < sizeof(long)) {
27824  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
27825  } else {
27826  long val = PyInt_AS_LONG(x);
27827  if (is_unsigned && unlikely(val < 0)) {
27828  goto raise_neg_overflow;
27829  }
27830  return (long) val;
27831  }
27832  } else
27833 #endif
27834  if (likely(PyLong_Check(x))) {
27835  if (is_unsigned) {
27836 #if CYTHON_USE_PYLONG_INTERNALS
27837  const digit* digits = ((PyLongObject*)x)->ob_digit;
27838  switch (Py_SIZE(x)) {
27839  case 0: return (long) 0;
27840  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
27841  case 2:
27842  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27843  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27844  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27845  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
27846  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27847  }
27848  }
27849  break;
27850  case 3:
27851  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27852  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27853  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27854  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
27855  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27856  }
27857  }
27858  break;
27859  case 4:
27860  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27861  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27862  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27863  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
27864  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27865  }
27866  }
27867  break;
27868  }
27869 #endif
27870 #if CYTHON_COMPILING_IN_CPYTHON
27871  if (unlikely(Py_SIZE(x) < 0)) {
27872  goto raise_neg_overflow;
27873  }
27874 #else
27875  {
27876  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27877  if (unlikely(result < 0))
27878  return (long) -1;
27879  if (unlikely(result == 1))
27880  goto raise_neg_overflow;
27881  }
27882 #endif
27883  if (sizeof(long) <= sizeof(unsigned long)) {
27884  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
27885 #ifdef HAVE_LONG_LONG
27886  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27887  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27888 #endif
27889  }
27890  } else {
27891 #if CYTHON_USE_PYLONG_INTERNALS
27892  const digit* digits = ((PyLongObject*)x)->ob_digit;
27893  switch (Py_SIZE(x)) {
27894  case 0: return (long) 0;
27895  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
27896  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
27897  case -2:
27898  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
27899  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27900  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27901  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27902  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27903  }
27904  }
27905  break;
27906  case 2:
27907  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27908  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27909  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27910  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27911  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27912  }
27913  }
27914  break;
27915  case -3:
27916  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27917  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27918  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27919  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27920  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27921  }
27922  }
27923  break;
27924  case 3:
27925  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27926  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27927  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27928  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27929  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27930  }
27931  }
27932  break;
27933  case -4:
27934  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27935  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27936  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27937  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27938  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27939  }
27940  }
27941  break;
27942  case 4:
27943  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27944  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27945  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27946  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27947  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27948  }
27949  }
27950  break;
27951  }
27952 #endif
27953  if (sizeof(long) <= sizeof(long)) {
27954  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
27955 #ifdef HAVE_LONG_LONG
27956  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27957  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
27958 #endif
27959  }
27960  }
27961  {
27962 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27963  PyErr_SetString(PyExc_RuntimeError,
27964  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27965 #else
27966  long val;
27967  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27968  #if PY_MAJOR_VERSION < 3
27969  if (likely(v) && !PyLong_Check(v)) {
27970  PyObject *tmp = v;
27971  v = PyNumber_Long(tmp);
27972  Py_DECREF(tmp);
27973  }
27974  #endif
27975  if (likely(v)) {
27976  int one = 1; int is_little = (int)*(unsigned char *)&one;
27977  unsigned char *bytes = (unsigned char *)&val;
27978  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27979  bytes, sizeof(val),
27980  is_little, !is_unsigned);
27981  Py_DECREF(v);
27982  if (likely(!ret))
27983  return val;
27984  }
27985 #endif
27986  return (long) -1;
27987  }
27988  } else {
27989  long val;
27990  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27991  if (!tmp) return (long) -1;
27992  val = __Pyx_PyInt_As_long(tmp);
27993  Py_DECREF(tmp);
27994  return val;
27995  }
27996 raise_overflow:
27997  PyErr_SetString(PyExc_OverflowError,
27998  "value too large to convert to long");
27999  return (long) -1;
28000 raise_neg_overflow:
28001  PyErr_SetString(PyExc_OverflowError,
28002  "can't convert negative value to long");
28003  return (long) -1;
28004 }
28005 
28006 /* CIntToPy */
28007 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28008  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
28009  const int is_unsigned = neg_one > const_zero;
28010  if (is_unsigned) {
28011  if (sizeof(long) < sizeof(long)) {
28012  return PyInt_FromLong((long) value);
28013  } else if (sizeof(long) <= sizeof(unsigned long)) {
28014  return PyLong_FromUnsignedLong((unsigned long) value);
28015 #ifdef HAVE_LONG_LONG
28016  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28017  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28018 #endif
28019  }
28020  } else {
28021  if (sizeof(long) <= sizeof(long)) {
28022  return PyInt_FromLong((long) value);
28023 #ifdef HAVE_LONG_LONG
28024  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28025  return PyLong_FromLongLong((PY_LONG_LONG) value);
28026 #endif
28027  }
28028  }
28029  {
28030  int one = 1; int little = (int)*(unsigned char *)&one;
28031  unsigned char *bytes = (unsigned char *)&value;
28032  return _PyLong_FromByteArray(bytes, sizeof(long),
28033  little, !is_unsigned);
28034  }
28035 }
28036 
28037 /* CIntFromPy */
28038 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28039  const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
28040  const int is_unsigned = neg_one > const_zero;
28041 #if PY_MAJOR_VERSION < 3
28042  if (likely(PyInt_Check(x))) {
28043  if (sizeof(char) < sizeof(long)) {
28044  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28045  } else {
28046  long val = PyInt_AS_LONG(x);
28047  if (is_unsigned && unlikely(val < 0)) {
28048  goto raise_neg_overflow;
28049  }
28050  return (char) val;
28051  }
28052  } else
28053 #endif
28054  if (likely(PyLong_Check(x))) {
28055  if (is_unsigned) {
28056 #if CYTHON_USE_PYLONG_INTERNALS
28057  const digit* digits = ((PyLongObject*)x)->ob_digit;
28058  switch (Py_SIZE(x)) {
28059  case 0: return (char) 0;
28060  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28061  case 2:
28062  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28063  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28064  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28065  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28066  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28067  }
28068  }
28069  break;
28070  case 3:
28071  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28072  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28073  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28074  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28075  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28076  }
28077  }
28078  break;
28079  case 4:
28080  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28081  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28082  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28083  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28084  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28085  }
28086  }
28087  break;
28088  }
28089 #endif
28090 #if CYTHON_COMPILING_IN_CPYTHON
28091  if (unlikely(Py_SIZE(x) < 0)) {
28092  goto raise_neg_overflow;
28093  }
28094 #else
28095  {
28096  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28097  if (unlikely(result < 0))
28098  return (char) -1;
28099  if (unlikely(result == 1))
28100  goto raise_neg_overflow;
28101  }
28102 #endif
28103  if (sizeof(char) <= sizeof(unsigned long)) {
28104  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28105 #ifdef HAVE_LONG_LONG
28106  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28107  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28108 #endif
28109  }
28110  } else {
28111 #if CYTHON_USE_PYLONG_INTERNALS
28112  const digit* digits = ((PyLongObject*)x)->ob_digit;
28113  switch (Py_SIZE(x)) {
28114  case 0: return (char) 0;
28115  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28116  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28117  case -2:
28118  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28119  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28120  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28121  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28122  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28123  }
28124  }
28125  break;
28126  case 2:
28127  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28128  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28129  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28130  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28131  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28132  }
28133  }
28134  break;
28135  case -3:
28136  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28137  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28138  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28139  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28140  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28141  }
28142  }
28143  break;
28144  case 3:
28145  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28146  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28147  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28148  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28149  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28150  }
28151  }
28152  break;
28153  case -4:
28154  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28155  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28156  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28157  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28158  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28159  }
28160  }
28161  break;
28162  case 4:
28163  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28164  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28165  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28166  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28167  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28168  }
28169  }
28170  break;
28171  }
28172 #endif
28173  if (sizeof(char) <= sizeof(long)) {
28174  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28175 #ifdef HAVE_LONG_LONG
28176  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28177  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28178 #endif
28179  }
28180  }
28181  {
28182 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28183  PyErr_SetString(PyExc_RuntimeError,
28184  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28185 #else
28186  char val;
28187  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28188  #if PY_MAJOR_VERSION < 3
28189  if (likely(v) && !PyLong_Check(v)) {
28190  PyObject *tmp = v;
28191  v = PyNumber_Long(tmp);
28192  Py_DECREF(tmp);
28193  }
28194  #endif
28195  if (likely(v)) {
28196  int one = 1; int is_little = (int)*(unsigned char *)&one;
28197  unsigned char *bytes = (unsigned char *)&val;
28198  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28199  bytes, sizeof(val),
28200  is_little, !is_unsigned);
28201  Py_DECREF(v);
28202  if (likely(!ret))
28203  return val;
28204  }
28205 #endif
28206  return (char) -1;
28207  }
28208  } else {
28209  char val;
28210  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28211  if (!tmp) return (char) -1;
28212  val = __Pyx_PyInt_As_char(tmp);
28213  Py_DECREF(tmp);
28214  return val;
28215  }
28216 raise_overflow:
28217  PyErr_SetString(PyExc_OverflowError,
28218  "value too large to convert to char");
28219  return (char) -1;
28220 raise_neg_overflow:
28221  PyErr_SetString(PyExc_OverflowError,
28222  "can't convert negative value to char");
28223  return (char) -1;
28224 }
28225 
28226 /* IsLittleEndian */
28227 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
28228 {
28229  union {
28230  uint32_t u32;
28231  uint8_t u8[4];
28232  } S;
28233  S.u32 = 0x01020304;
28234  return S.u8[0] == 4;
28235 }
28236 
28237 /* BufferFormatCheck */
28238 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
28239  __Pyx_BufFmt_StackElem* stack,
28240  __Pyx_TypeInfo* type) {
28241  stack[0].field = &ctx->root;
28242  stack[0].parent_offset = 0;
28243  ctx->root.type = type;
28244  ctx->root.name = "buffer dtype";
28245  ctx->root.offset = 0;
28246  ctx->head = stack;
28247  ctx->head->field = &ctx->root;
28248  ctx->fmt_offset = 0;
28249  ctx->head->parent_offset = 0;
28250  ctx->new_packmode = '@';
28251  ctx->enc_packmode = '@';
28252  ctx->new_count = 1;
28253  ctx->enc_count = 0;
28254  ctx->enc_type = 0;
28255  ctx->is_complex = 0;
28256  ctx->is_valid_array = 0;
28257  ctx->struct_alignment = 0;
28258  while (type->typegroup == 'S') {
28259  ++ctx->head;
28260  ctx->head->field = type->fields;
28261  ctx->head->parent_offset = 0;
28262  type = type->fields->type;
28263  }
28264 }
28265 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
28266  int count;
28267  const char* t = *ts;
28268  if (*t < '0' || *t > '9') {
28269  return -1;
28270  } else {
28271  count = *t++ - '0';
28272  while (*t >= '0' && *t <= '9') {
28273  count *= 10;
28274  count += *t++ - '0';
28275  }
28276  }
28277  *ts = t;
28278  return count;
28279 }
28280 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
28281  int number = __Pyx_BufFmt_ParseNumber(ts);
28282  if (number == -1)
28283  PyErr_Format(PyExc_ValueError,\
28284  "Does not understand character buffer dtype format string ('%c')", **ts);
28285  return number;
28286 }
28287 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
28288  PyErr_Format(PyExc_ValueError,
28289  "Unexpected format string character: '%c'", ch);
28290 }
28291 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
28292  switch (ch) {
28293  case '?': return "'bool'";
28294  case 'c': return "'char'";
28295  case 'b': return "'signed char'";
28296  case 'B': return "'unsigned char'";
28297  case 'h': return "'short'";
28298  case 'H': return "'unsigned short'";
28299  case 'i': return "'int'";
28300  case 'I': return "'unsigned int'";
28301  case 'l': return "'long'";
28302  case 'L': return "'unsigned long'";
28303  case 'q': return "'long long'";
28304  case 'Q': return "'unsigned long long'";
28305  case 'f': return (is_complex ? "'complex float'" : "'float'");
28306  case 'd': return (is_complex ? "'complex double'" : "'double'");
28307  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
28308  case 'T': return "a struct";
28309  case 'O': return "Python object";
28310  case 'P': return "a pointer";
28311  case 's': case 'p': return "a string";
28312  case 0: return "end";
28313  default: return "unparseable format string";
28314  }
28315 }
28316 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
28317  switch (ch) {
28318  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28319  case 'h': case 'H': return 2;
28320  case 'i': case 'I': case 'l': case 'L': return 4;
28321  case 'q': case 'Q': return 8;
28322  case 'f': return (is_complex ? 8 : 4);
28323  case 'd': return (is_complex ? 16 : 8);
28324  case 'g': {
28325  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
28326  return 0;
28327  }
28328  case 'O': case 'P': return sizeof(void*);
28329  default:
28330  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28331  return 0;
28332  }
28333 }
28334 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
28335  switch (ch) {
28336  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28337  case 'h': case 'H': return sizeof(short);
28338  case 'i': case 'I': return sizeof(int);
28339  case 'l': case 'L': return sizeof(long);
28340  #ifdef HAVE_LONG_LONG
28341  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
28342  #endif
28343  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
28344  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
28345  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
28346  case 'O': case 'P': return sizeof(void*);
28347  default: {
28348  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28349  return 0;
28350  }
28351  }
28352 }
28353 typedef struct { char c; short x; } __Pyx_st_short;
28354 typedef struct { char c; int x; } __Pyx_st_int;
28355 typedef struct { char c; long x; } __Pyx_st_long;
28356 typedef struct { char c; float x; } __Pyx_st_float;
28357 typedef struct { char c; double x; } __Pyx_st_double;
28358 typedef struct { char c; long double x; } __Pyx_st_longdouble;
28359 typedef struct { char c; void *x; } __Pyx_st_void_p;
28360 #ifdef HAVE_LONG_LONG
28361 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
28362 #endif
28363 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
28364  switch (ch) {
28365  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28366  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
28367  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
28368  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
28369 #ifdef HAVE_LONG_LONG
28370  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
28371 #endif
28372  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
28373  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
28374  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
28375  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
28376  default:
28377  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28378  return 0;
28379  }
28380 }
28381 /* These are for computing the padding at the end of the struct to align
28382  on the first member of the struct. This will probably the same as above,
28383  but we don't have any guarantees.
28384  */
28385 typedef struct { short x; char c; } __Pyx_pad_short;
28386 typedef struct { int x; char c; } __Pyx_pad_int;
28387 typedef struct { long x; char c; } __Pyx_pad_long;
28388 typedef struct { float x; char c; } __Pyx_pad_float;
28389 typedef struct { double x; char c; } __Pyx_pad_double;
28390 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
28391 typedef struct { void *x; char c; } __Pyx_pad_void_p;
28392 #ifdef HAVE_LONG_LONG
28393 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
28394 #endif
28395 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
28396  switch (ch) {
28397  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28398  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
28399  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
28400  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
28401 #ifdef HAVE_LONG_LONG
28402  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
28403 #endif
28404  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
28405  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
28406  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
28407  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
28408  default:
28409  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28410  return 0;
28411  }
28412 }
28413 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
28414  switch (ch) {
28415  case 'c':
28416  return 'H';
28417  case 'b': case 'h': case 'i':
28418  case 'l': case 'q': case 's': case 'p':
28419  return 'I';
28420  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
28421  return 'U';
28422  case 'f': case 'd': case 'g':
28423  return (is_complex ? 'C' : 'R');
28424  case 'O':
28425  return 'O';
28426  case 'P':
28427  return 'P';
28428  default: {
28429  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28430  return 0;
28431  }
28432  }
28433 }
28434 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
28435  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
28436  const char* expected;
28437  const char* quote;
28438  if (ctx->head == NULL) {
28439  expected = "end";
28440  quote = "";
28441  } else {
28442  expected = ctx->head->field->type->name;
28443  quote = "'";
28444  }
28445  PyErr_Format(PyExc_ValueError,
28446  "Buffer dtype mismatch, expected %s%s%s but got %s",
28447  quote, expected, quote,
28448  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
28449  } else {
28450  __Pyx_StructField* field = ctx->head->field;
28451  __Pyx_StructField* parent = (ctx->head - 1)->field;
28452  PyErr_Format(PyExc_ValueError,
28453  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
28454  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
28455  parent->type->name, field->name);
28456  }
28457 }
28458 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
28459  char group;
28460  size_t size, offset, arraysize = 1;
28461  if (ctx->enc_type == 0) return 0;
28462  if (ctx->head->field->type->arraysize[0]) {
28463  int i, ndim = 0;
28464  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
28465  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
28466  ndim = 1;
28467  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
28468  PyErr_Format(PyExc_ValueError,
28469  "Expected a dimension of size %zu, got %zu",
28470  ctx->head->field->type->arraysize[0], ctx->enc_count);
28471  return -1;
28472  }
28473  }
28474  if (!ctx->is_valid_array) {
28475  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
28476  ctx->head->field->type->ndim, ndim);
28477  return -1;
28478  }
28479  for (i = 0; i < ctx->head->field->type->ndim; i++) {
28480  arraysize *= ctx->head->field->type->arraysize[i];
28481  }
28482  ctx->is_valid_array = 0;
28483  ctx->enc_count = 1;
28484  }
28485  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
28486  do {
28487  __Pyx_StructField* field = ctx->head->field;
28488  __Pyx_TypeInfo* type = field->type;
28489  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
28490  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
28491  } else {
28492  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
28493  }
28494  if (ctx->enc_packmode == '@') {
28495  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
28496  size_t align_mod_offset;
28497  if (align_at == 0) return -1;
28498  align_mod_offset = ctx->fmt_offset % align_at;
28499  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
28500  if (ctx->struct_alignment == 0)
28501  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
28502  ctx->is_complex);
28503  }
28504  if (type->size != size || type->typegroup != group) {
28505  if (type->typegroup == 'C' && type->fields != NULL) {
28506  size_t parent_offset = ctx->head->parent_offset + field->offset;
28507  ++ctx->head;
28508  ctx->head->field = type->fields;
28509  ctx->head->parent_offset = parent_offset;
28510  continue;
28511  }
28512  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
28513  } else {
28514  __Pyx_BufFmt_RaiseExpected(ctx);
28515  return -1;
28516  }
28517  }
28518  offset = ctx->head->parent_offset + field->offset;
28519  if (ctx->fmt_offset != offset) {
28520  PyErr_Format(PyExc_ValueError,
28521  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
28522  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
28523  return -1;
28524  }
28525  ctx->fmt_offset += size;
28526  if (arraysize)
28527  ctx->fmt_offset += (arraysize - 1) * size;
28528  --ctx->enc_count;
28529  while (1) {
28530  if (field == &ctx->root) {
28531  ctx->head = NULL;
28532  if (ctx->enc_count != 0) {
28533  __Pyx_BufFmt_RaiseExpected(ctx);
28534  return -1;
28535  }
28536  break;
28537  }
28538  ctx->head->field = ++field;
28539  if (field->type == NULL) {
28540  --ctx->head;
28541  field = ctx->head->field;
28542  continue;
28543  } else if (field->type->typegroup == 'S') {
28544  size_t parent_offset = ctx->head->parent_offset + field->offset;
28545  if (field->type->fields->type == NULL) continue;
28546  field = field->type->fields;
28547  ++ctx->head;
28548  ctx->head->field = field;
28549  ctx->head->parent_offset = parent_offset;
28550  break;
28551  } else {
28552  break;
28553  }
28554  }
28555  } while (ctx->enc_count);
28556  ctx->enc_type = 0;
28557  ctx->is_complex = 0;
28558  return 0;
28559 }
28560 static PyObject *
28561 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
28562 {
28563  const char *ts = *tsp;
28564  int i = 0, number, ndim;
28565  ++ts;
28566  if (ctx->new_count != 1) {
28567  PyErr_SetString(PyExc_ValueError,
28568  "Cannot handle repeated arrays in format string");
28569  return NULL;
28570  }
28571  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28572  ndim = ctx->head->field->type->ndim;
28573  while (*ts && *ts != ')') {
28574  switch (*ts) {
28575  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
28576  default: break;
28577  }
28578  number = __Pyx_BufFmt_ExpectNumber(&ts);
28579  if (number == -1) return NULL;
28580  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
28581  return PyErr_Format(PyExc_ValueError,
28582  "Expected a dimension of size %zu, got %d",
28583  ctx->head->field->type->arraysize[i], number);
28584  if (*ts != ',' && *ts != ')')
28585  return PyErr_Format(PyExc_ValueError,
28586  "Expected a comma in format string, got '%c'", *ts);
28587  if (*ts == ',') ts++;
28588  i++;
28589  }
28590  if (i != ndim)
28591  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
28592  ctx->head->field->type->ndim, i);
28593  if (!*ts) {
28594  PyErr_SetString(PyExc_ValueError,
28595  "Unexpected end of format string, expected ')'");
28596  return NULL;
28597  }
28598  ctx->is_valid_array = 1;
28599  ctx->new_count = 1;
28600  *tsp = ++ts;
28601  return Py_None;
28602 }
28603 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
28604  int got_Z = 0;
28605  while (1) {
28606  switch(*ts) {
28607  case 0:
28608  if (ctx->enc_type != 0 && ctx->head == NULL) {
28609  __Pyx_BufFmt_RaiseExpected(ctx);
28610  return NULL;
28611  }
28612  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28613  if (ctx->head != NULL) {
28614  __Pyx_BufFmt_RaiseExpected(ctx);
28615  return NULL;
28616  }
28617  return ts;
28618  case ' ':
28619  case '\r':
28620  case '\n':
28621  ++ts;
28622  break;
28623  case '<':
28624  if (!__Pyx_Is_Little_Endian()) {
28625  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
28626  return NULL;
28627  }
28628  ctx->new_packmode = '=';
28629  ++ts;
28630  break;
28631  case '>':
28632  case '!':
28633  if (__Pyx_Is_Little_Endian()) {
28634  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
28635  return NULL;
28636  }
28637  ctx->new_packmode = '=';
28638  ++ts;
28639  break;
28640  case '=':
28641  case '@':
28642  case '^':
28643  ctx->new_packmode = *ts++;
28644  break;
28645  case 'T':
28646  {
28647  const char* ts_after_sub;
28648  size_t i, struct_count = ctx->new_count;
28649  size_t struct_alignment = ctx->struct_alignment;
28650  ctx->new_count = 1;
28651  ++ts;
28652  if (*ts != '{') {
28653  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
28654  return NULL;
28655  }
28656  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28657  ctx->enc_type = 0;
28658  ctx->enc_count = 0;
28659  ctx->struct_alignment = 0;
28660  ++ts;
28661  ts_after_sub = ts;
28662  for (i = 0; i != struct_count; ++i) {
28663  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
28664  if (!ts_after_sub) return NULL;
28665  }
28666  ts = ts_after_sub;
28667  if (struct_alignment) ctx->struct_alignment = struct_alignment;
28668  }
28669  break;
28670  case '}':
28671  {
28672  size_t alignment = ctx->struct_alignment;
28673  ++ts;
28674  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28675  ctx->enc_type = 0;
28676  if (alignment && ctx->fmt_offset % alignment) {
28677  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
28678  }
28679  }
28680  return ts;
28681  case 'x':
28682  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28683  ctx->fmt_offset += ctx->new_count;
28684  ctx->new_count = 1;
28685  ctx->enc_count = 0;
28686  ctx->enc_type = 0;
28687  ctx->enc_packmode = ctx->new_packmode;
28688  ++ts;
28689  break;
28690  case 'Z':
28691  got_Z = 1;
28692  ++ts;
28693  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
28694  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
28695  return NULL;
28696  }
28697  CYTHON_FALLTHROUGH;
28698  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
28699  case 'l': case 'L': case 'q': case 'Q':
28700  case 'f': case 'd': case 'g':
28701  case 'O': case 'p':
28702  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
28703  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
28704  ctx->enc_count += ctx->new_count;
28705  ctx->new_count = 1;
28706  got_Z = 0;
28707  ++ts;
28708  break;
28709  }
28710  CYTHON_FALLTHROUGH;
28711  case 's':
28712  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28713  ctx->enc_count = ctx->new_count;
28714  ctx->enc_packmode = ctx->new_packmode;
28715  ctx->enc_type = *ts;
28716  ctx->is_complex = got_Z;
28717  ++ts;
28718  ctx->new_count = 1;
28719  got_Z = 0;
28720  break;
28721  case ':':
28722  ++ts;
28723  while(*ts != ':') ++ts;
28724  ++ts;
28725  break;
28726  case '(':
28727  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
28728  break;
28729  default:
28730  {
28731  int number = __Pyx_BufFmt_ExpectNumber(&ts);
28732  if (number == -1) return NULL;
28733  ctx->new_count = (size_t)number;
28734  }
28735  }
28736  }
28737 }
28738 
28739 /* TypeInfoCompare */
28740  static int
28741 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
28742 {
28743  int i;
28744  if (!a || !b)
28745  return 0;
28746  if (a == b)
28747  return 1;
28748  if (a->size != b->size || a->typegroup != b->typegroup ||
28749  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
28750  if (a->typegroup == 'H' || b->typegroup == 'H') {
28751  return a->size == b->size;
28752  } else {
28753  return 0;
28754  }
28755  }
28756  if (a->ndim) {
28757  for (i = 0; i < a->ndim; i++)
28758  if (a->arraysize[i] != b->arraysize[i])
28759  return 0;
28760  }
28761  if (a->typegroup == 'S') {
28762  if (a->flags != b->flags)
28763  return 0;
28764  if (a->fields || b->fields) {
28765  if (!(a->fields && b->fields))
28766  return 0;
28767  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
28768  __Pyx_StructField *field_a = a->fields + i;
28769  __Pyx_StructField *field_b = b->fields + i;
28770  if (field_a->offset != field_b->offset ||
28771  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
28772  return 0;
28773  }
28774  return !a->fields[i].type && !b->fields[i].type;
28775  }
28776  }
28777  return 1;
28778 }
28779 
28780 /* MemviewSliceValidateAndInit */
28781  static int
28782 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
28783 {
28784  if (buf->shape[dim] <= 1)
28785  return 1;
28786  if (buf->strides) {
28787  if (spec & __Pyx_MEMVIEW_CONTIG) {
28788  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
28789  if (unlikely(buf->strides[dim] != sizeof(void *))) {
28790  PyErr_Format(PyExc_ValueError,
28791  "Buffer is not indirectly contiguous "
28792  "in dimension %d.", dim);
28793  goto fail;
28794  }
28795  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
28796  PyErr_SetString(PyExc_ValueError,
28797  "Buffer and memoryview are not contiguous "
28798  "in the same dimension.");
28799  goto fail;
28800  }
28801  }
28802  if (spec & __Pyx_MEMVIEW_FOLLOW) {
28803  Py_ssize_t stride = buf->strides[dim];
28804  if (stride < 0)
28805  stride = -stride;
28806  if (unlikely(stride < buf->itemsize)) {
28807  PyErr_SetString(PyExc_ValueError,
28808  "Buffer and memoryview are not contiguous "
28809  "in the same dimension.");
28810  goto fail;
28811  }
28812  }
28813  } else {
28814  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
28815  PyErr_Format(PyExc_ValueError,
28816  "C-contiguous buffer is not contiguous in "
28817  "dimension %d", dim);
28818  goto fail;
28819  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
28820  PyErr_Format(PyExc_ValueError,
28821  "C-contiguous buffer is not indirect in "
28822  "dimension %d", dim);
28823  goto fail;
28824  } else if (unlikely(buf->suboffsets)) {
28825  PyErr_SetString(PyExc_ValueError,
28826  "Buffer exposes suboffsets but no strides");
28827  goto fail;
28828  }
28829  }
28830  return 1;
28831 fail:
28832  return 0;
28833 }
28834 static int
28835 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
28836 {
28837  if (spec & __Pyx_MEMVIEW_DIRECT) {
28838  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
28839  PyErr_Format(PyExc_ValueError,
28840  "Buffer not compatible with direct access "
28841  "in dimension %d.", dim);
28842  goto fail;
28843  }
28844  }
28845  if (spec & __Pyx_MEMVIEW_PTR) {
28846  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
28847  PyErr_Format(PyExc_ValueError,
28848  "Buffer is not indirectly accessible "
28849  "in dimension %d.", dim);
28850  goto fail;
28851  }
28852  }
28853  return 1;
28854 fail:
28855  return 0;
28856 }
28857 static int
28858 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
28859 {
28860  int i;
28861  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
28862  Py_ssize_t stride = 1;
28863  for (i = 0; i < ndim; i++) {
28864  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
28865  PyErr_SetString(PyExc_ValueError,
28866  "Buffer not fortran contiguous.");
28867  goto fail;
28868  }
28869  stride = stride * buf->shape[i];
28870  }
28871  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
28872  Py_ssize_t stride = 1;
28873  for (i = ndim - 1; i >- 1; i--) {
28874  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
28875  PyErr_SetString(PyExc_ValueError,
28876  "Buffer not C contiguous.");
28877  goto fail;
28878  }
28879  stride = stride * buf->shape[i];
28880  }
28881  }
28882  return 1;
28883 fail:
28884  return 0;
28885 }
28886 static int __Pyx_ValidateAndInit_memviewslice(
28887  int *axes_specs,
28888  int c_or_f_flag,
28889  int buf_flags,
28890  int ndim,
28891  __Pyx_TypeInfo *dtype,
28892  __Pyx_BufFmt_StackElem stack[],
28893  __Pyx_memviewslice *memviewslice,
28894  PyObject *original_obj)
28895 {
28896  struct __pyx_memoryview_obj *memview, *new_memview;
28897  __Pyx_RefNannyDeclarations
28898  Py_buffer *buf;
28899  int i, spec = 0, retval = -1;
28900  __Pyx_BufFmt_Context ctx;
28901  int from_memoryview = __pyx_memoryview_check(original_obj);
28902  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
28903  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
28904  original_obj)->typeinfo)) {
28905  memview = (struct __pyx_memoryview_obj *) original_obj;
28906  new_memview = NULL;
28907  } else {
28908  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28909  original_obj, buf_flags, 0, dtype);
28910  new_memview = memview;
28911  if (unlikely(!memview))
28912  goto fail;
28913  }
28914  buf = &memview->view;
28915  if (unlikely(buf->ndim != ndim)) {
28916  PyErr_Format(PyExc_ValueError,
28917  "Buffer has wrong number of dimensions (expected %d, got %d)",
28918  ndim, buf->ndim);
28919  goto fail;
28920  }
28921  if (new_memview) {
28922  __Pyx_BufFmt_Init(&ctx, stack, dtype);
28923  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
28924  }
28925  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
28926  PyErr_Format(PyExc_ValueError,
28927  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
28928  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
28929  buf->itemsize,
28930  (buf->itemsize > 1) ? "s" : "",
28931  dtype->name,
28932  dtype->size,
28933  (dtype->size > 1) ? "s" : "");
28934  goto fail;
28935  }
28936  if (buf->len > 0) {
28937  for (i = 0; i < ndim; i++) {
28938  spec = axes_specs[i];
28939  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
28940  goto fail;
28941  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
28942  goto fail;
28943  }
28944  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
28945  goto fail;
28946  }
28947  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
28948  new_memview != NULL) == -1)) {
28949  goto fail;
28950  }
28951  retval = 0;
28952  goto no_fail;
28953 fail:
28954  Py_XDECREF(new_memview);
28955  retval = -1;
28956 no_fail:
28957  __Pyx_RefNannyFinishContext();
28958  return retval;
28959 }
28960 
28961 /* ObjectToMemviewSlice */
28962  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
28963  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28964  __Pyx_BufFmt_StackElem stack[1];
28965  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28966  int retcode;
28967  if (obj == Py_None) {
28968  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28969  return result;
28970  }
28971  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28972  PyBUF_RECORDS_RO | writable_flag, 1,
28973  &__Pyx_TypeInfo_double, stack,
28974  &result, obj);
28975  if (unlikely(retcode == -1))
28976  goto __pyx_fail;
28977  return result;
28978 __pyx_fail:
28979  result.memview = NULL;
28980  result.data = NULL;
28981  return result;
28982 }
28983 
28984 /* ObjectToMemviewSlice */
28985  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
28986  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28987  __Pyx_BufFmt_StackElem stack[1];
28988  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28989  int retcode;
28990  if (obj == Py_None) {
28991  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28992  return result;
28993  }
28994  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28995  PyBUF_RECORDS_RO | writable_flag, 1,
28996  &__Pyx_TypeInfo_int, stack,
28997  &result, obj);
28998  if (unlikely(retcode == -1))
28999  goto __pyx_fail;
29000  return result;
29001 __pyx_fail:
29002  result.memview = NULL;
29003  result.data = NULL;
29004  return result;
29005 }
29006 
29007 /* CheckBinaryVersion */
29008  static int __Pyx_check_binary_version(void) {
29009  char ctversion[4], rtversion[4];
29010  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29011  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
29012  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
29013  char message[200];
29014  PyOS_snprintf(message, sizeof(message),
29015  "compiletime version %s of module '%.100s' "
29016  "does not match runtime version %s",
29017  ctversion, __Pyx_MODULE_NAME, rtversion);
29018  return PyErr_WarnEx(NULL, message, 1);
29019  }
29020  return 0;
29021 }
29022 
29023 /* InitStrings */
29024  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29025  while (t->p) {
29026  #if PY_MAJOR_VERSION < 3
29027  if (t->is_unicode) {
29028  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29029  } else if (t->intern) {
29030  *t->p = PyString_InternFromString(t->s);
29031  } else {
29032  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29033  }
29034  #else
29035  if (t->is_unicode | t->is_str) {
29036  if (t->intern) {
29037  *t->p = PyUnicode_InternFromString(t->s);
29038  } else if (t->encoding) {
29039  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29040  } else {
29041  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29042  }
29043  } else {
29044  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29045  }
29046  #endif
29047  if (!*t->p)
29048  return -1;
29049  if (PyObject_Hash(*t->p) == -1)
29050  return -1;
29051  ++t;
29052  }
29053  return 0;
29054 }
29055 
29056 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
29057  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29058 }
29059 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
29060  Py_ssize_t ignore;
29061  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29062 }
29063 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29064 #if !CYTHON_PEP393_ENABLED
29065 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29066  char* defenc_c;
29067  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29068  if (!defenc) return NULL;
29069  defenc_c = PyBytes_AS_STRING(defenc);
29070 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29071  {
29072  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29073  char* c;
29074  for (c = defenc_c; c < end; c++) {
29075  if ((unsigned char) (*c) >= 128) {
29076  PyUnicode_AsASCIIString(o);
29077  return NULL;
29078  }
29079  }
29080  }
29081 #endif
29082  *length = PyBytes_GET_SIZE(defenc);
29083  return defenc_c;
29084 }
29085 #else
29086 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29087  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
29088 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29089  if (likely(PyUnicode_IS_ASCII(o))) {
29090  *length = PyUnicode_GET_LENGTH(o);
29091  return PyUnicode_AsUTF8(o);
29092  } else {
29093  PyUnicode_AsASCIIString(o);
29094  return NULL;
29095  }
29096 #else
29097  return PyUnicode_AsUTF8AndSize(o, length);
29098 #endif
29099 }
29100 #endif
29101 #endif
29102 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29103 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29104  if (
29105 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29106  __Pyx_sys_getdefaultencoding_not_ascii &&
29107 #endif
29108  PyUnicode_Check(o)) {
29109  return __Pyx_PyUnicode_AsStringAndSize(o, length);
29110  } else
29111 #endif
29112 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29113  if (PyByteArray_Check(o)) {
29114  *length = PyByteArray_GET_SIZE(o);
29115  return PyByteArray_AS_STRING(o);
29116  } else
29117 #endif
29118  {
29119  char* result;
29120  int r = PyBytes_AsStringAndSize(o, &result, length);
29121  if (unlikely(r < 0)) {
29122  return NULL;
29123  } else {
29124  return result;
29125  }
29126  }
29127 }
29128 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
29129  int is_true = x == Py_True;
29130  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
29131  else return PyObject_IsTrue(x);
29132 }
29133 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29134  int retval;
29135  if (unlikely(!x)) return -1;
29136  retval = __Pyx_PyObject_IsTrue(x);
29137  Py_DECREF(x);
29138  return retval;
29139 }
29140 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
29141 #if PY_MAJOR_VERSION >= 3
29142  if (PyLong_Check(result)) {
29143  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29144  "__int__ returned non-int (type %.200s). "
29145  "The ability to return an instance of a strict subclass of int "
29146  "is deprecated, and may be removed in a future version of Python.",
29147  Py_TYPE(result)->tp_name)) {
29148  Py_DECREF(result);
29149  return NULL;
29150  }
29151  return result;
29152  }
29153 #endif
29154  PyErr_Format(PyExc_TypeError,
29155  "__%.4s__ returned non-%.4s (type %.200s)",
29156  type_name, type_name, Py_TYPE(result)->tp_name);
29157  Py_DECREF(result);
29158  return NULL;
29159 }
29160 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29161 #if CYTHON_USE_TYPE_SLOTS
29162  PyNumberMethods *m;
29163 #endif
29164  const char *name = NULL;
29165  PyObject *res = NULL;
29166 #if PY_MAJOR_VERSION < 3
29167  if (likely(PyInt_Check(x) || PyLong_Check(x)))
29168 #else
29169  if (likely(PyLong_Check(x)))
29170 #endif
29171  return __Pyx_NewRef(x);
29172 #if CYTHON_USE_TYPE_SLOTS
29173  m = Py_TYPE(x)->tp_as_number;
29174  #if PY_MAJOR_VERSION < 3
29175  if (m && m->nb_int) {
29176  name = "int";
29177  res = m->nb_int(x);
29178  }
29179  else if (m && m->nb_long) {
29180  name = "long";
29181  res = m->nb_long(x);
29182  }
29183  #else
29184  if (likely(m && m->nb_int)) {
29185  name = "int";
29186  res = m->nb_int(x);
29187  }
29188  #endif
29189 #else
29190  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29191  res = PyNumber_Int(x);
29192  }
29193 #endif
29194  if (likely(res)) {
29195 #if PY_MAJOR_VERSION < 3
29196  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29197 #else
29198  if (unlikely(!PyLong_CheckExact(res))) {
29199 #endif
29200  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29201  }
29202  }
29203  else if (!PyErr_Occurred()) {
29204  PyErr_SetString(PyExc_TypeError,
29205  "an integer is required");
29206  }
29207  return res;
29208 }
29209 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29210  Py_ssize_t ival;
29211  PyObject *x;
29212 #if PY_MAJOR_VERSION < 3
29213  if (likely(PyInt_CheckExact(b))) {
29214  if (sizeof(Py_ssize_t) >= sizeof(long))
29215  return PyInt_AS_LONG(b);
29216  else
29217  return PyInt_AsSsize_t(b);
29218  }
29219 #endif
29220  if (likely(PyLong_CheckExact(b))) {
29221  #if CYTHON_USE_PYLONG_INTERNALS
29222  const digit* digits = ((PyLongObject*)b)->ob_digit;
29223  const Py_ssize_t size = Py_SIZE(b);
29224  if (likely(__Pyx_sst_abs(size) <= 1)) {
29225  ival = likely(size) ? digits[0] : 0;
29226  if (size == -1) ival = -ival;
29227  return ival;
29228  } else {
29229  switch (size) {
29230  case 2:
29231  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29232  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29233  }
29234  break;
29235  case -2:
29236  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29237  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29238  }
29239  break;
29240  case 3:
29241  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29242  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29243  }
29244  break;
29245  case -3:
29246  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29247  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29248  }
29249  break;
29250  case 4:
29251  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29252  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29253  }
29254  break;
29255  case -4:
29256  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29257  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29258  }
29259  break;
29260  }
29261  }
29262  #endif
29263  return PyLong_AsSsize_t(b);
29264  }
29265  x = PyNumber_Index(b);
29266  if (!x) return -1;
29267  ival = PyInt_AsSsize_t(x);
29268  Py_DECREF(x);
29269  return ival;
29270 }
29271 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
29272  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29273 }
29274 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
29275  return PyInt_FromSize_t(ival);
29276 }
29277 
29278 
29279 #endif /* Py_PYTHON_H */
asm_NR_prepare
void asm_NR_prepare(SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots)
Definition: smoothers.c:293
jacobi_NR_prepare
void jacobi_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
Definition: smoothers.c:10
basm_NR_prepare
void basm_NR_prepare(int rowBlocks, int N, SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
Definition: smoothers.c:602
smoothers.h
C implementations of multilevel smoother algorithms.
jacobi_NR_solve
void jacobi_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
Definition: smoothers.c:15
gauss_seidel_NR_prepare
void gauss_seidel_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
Definition: smoothers.c:71
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
asm_NR_free
void asm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots)
Definition: smoothers.c:268
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
basm_NR_init
int basm_NR_init(int rowBlocks, SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p, PROTEUS_LAPACK_INTEGER ***subdomain_col_pivots_p)
Definition: smoothers.c:391
asm_NR_init
int asm_NR_init(SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p)
Definition: smoothers.c:189
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
ns
Int ns
Definition: Headers.h:30
c
Double c
Definition: Headers.h:54
asm_NR_solve
void asm_NR_solve(SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots)
Definition: smoothers.c:324
basm_NR_free
void basm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots, PROTEUS_LAPACK_INTEGER **subdomain_col_pivots)
Definition: smoothers.c:574
proteus_superlu.h
nl_gauss_seidel_NR_solve
void nl_gauss_seidel_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
Definition: smoothers.c:142
nl_jacobi_NR_solve
void nl_jacobi_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
Definition: smoothers.c:26
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
gauss_seidel_NR_solve
void gauss_seidel_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
Definition: smoothers.c:114
basm_NR_solve
void basm_NR_solve(int rowBlocks, int N, SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
Definition: smoothers.c:668
nnz
#define nnz
Definition: Richards.h:8